Skip to content

Commit

Permalink
v1.2.1 fix overlapping labels with custom line
Browse files Browse the repository at this point in the history
  • Loading branch information
ellsworthrw committed Oct 7, 2022
1 parent 49d6074 commit afd51b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ tasks {
}

extra["artifactID"] = "charts-android"
extra["artifactVersion"] = "1.2.0"
extra["artifactVersion"] = "1.2.1"
extra["libraryName"] = "Diamond Charts"
extra["libraryDescription"] = "Diamond Charts: charting library for Android Jetpack Compose"
extra["gitUrl"] = "https://github.com/ellsworthrw/DiamondCharts"
Expand Down
2 changes: 2 additions & 0 deletions charts/src/main/java/com/diamondedge/charts/Axis.kt
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@ open class Axis protected constructor() {
var customLabelLeft = convertToPixel(customLineValue)
if (align == TickLabelPosition.TickCenter)
customLabelLeft -= g.stringWidth(customLineLabel.toString()) / 2
else
customLabelLeft += tickLabelGap
val customLabelRight = customLabelLeft + g.stringWidth(customLineLabel.toString()) + g.dpToPixel(4f)
val labelWidth = strWidth + g.dpToPixel(4f)
if (x > customLabelRight) {
Expand Down

0 comments on commit afd51b0

Please sign in to comment.