Created
June 25, 2023 10:03
-
-
Save nikhil-mandlik-dev/c63216cf94b63367eb36eaeb4aa741c7 to your computer and use it in GitHub Desktop.
Drawing Hour Label
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//draw hour | |
val hourString = String.format("%02d", hour) | |
val hourTextMeasureOutput = textMeasurer.measure( | |
text = buildAnnotatedString { append(hourString) }, | |
style = clockStyle.hourLabelStyle | |
) | |
val hourTopLeft = Offset( | |
x = this.center.x - (hourTextMeasureOutput.size.width / 2), | |
y = this.center.y - (hourTextMeasureOutput.size.height / 2) | |
) | |
drawText( | |
textMeasurer = textMeasurer, | |
text = hourString, | |
topLeft = hourTopLeft, | |
style = clockStyle.hourLabelStyle | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment