Skip to content

Commit

Permalink
fix: Fix auto graph margin adjust logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Taewan-P committed Dec 7, 2023
1 parent 9b4177a commit 23d9e75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/app/priceguard/materialchart/Chart.kt
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ class Chart @JvmOverloads constructor(
val labelStartPointY: Px = startPointY + marginTop.toPx(context) + textHeight

canvas.save()
if (yAxisMarginStart.toPx(context).value < textWidth.value * ONE_OVER_SQRT_2) {
if ((yAxisMarginStart - halfTickLength - marginTop).toPx(context).value < textWidth.value * ONE_OVER_SQRT_2) {
// Automatically adjusts the graph margin
yAxisMarginStart = Px(
(textWidth.value * ONE_OVER_SQRT_2).roundToInt().toFloat()
Expand Down

0 comments on commit 23d9e75

Please sign in to comment.