Skip to content

Commit

Permalink
Fix BulletGraph vertical centering of ranges.
Browse files Browse the repository at this point in the history
  • Loading branch information
gsteckman committed Oct 5, 2024
1 parent 32808e9 commit d9778bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Fixed

- #81 Add coerceAtLeast to rememberIntLinearAxisModel to fix Zoom range limit when range is small
- BulletGraph vertical centering of ranges

### Removed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,9 @@ public class BulletBuilderScope<T>(private val axisModel: LinearAxisModel<T>) wh
}
HorizontalBarIndicator(SolidColor(Color(shade, shade, shade)))
} else {
Box(modifier = Modifier.fillMaxSize()) { range.indicator.invoke() }
Box(contentAlignment = Alignment.CenterStart, modifier = Modifier.fillMaxSize()) {
range.indicator.invoke()
}
}
}
}
Expand Down Expand Up @@ -400,10 +402,9 @@ public class BulletBuilderScope<T>(private val axisModel: LinearAxisModel<T>) wh
Modifier.size(rangeHeight.toDp(), rangeHeight.toDp())
}

Box(
contentAlignment = Alignment.Center,
modifier = sizeModifier
) { featuredMeasure.indicator() }
Box(contentAlignment = Alignment.Center, modifier = sizeModifier) {
featuredMeasure.indicator()
}
}
}[0]

Expand Down Expand Up @@ -497,7 +498,7 @@ public class BulletBuilderScope<T>(private val axisModel: LinearAxisModel<T>) wh
} else {
rangeWidth * axisModel.computeOffset(value) - it.width / 2
}
it.place(xPos.roundToInt(), yPos + rangeHeight / 2 - it.height / 2)
it.place(xPos.roundToInt(), yPos)
}
}

Expand Down

0 comments on commit d9778bf

Please sign in to comment.