korge
korge copied to clipboard
Circles and RoundRects not rendering properly (blurry and bad strokes)
Circles and RoundRects are not rendering correctly.
The below image is using the same stroke (black and 3.0 thickness) for all shapes.
Through some trial and error I determine that it seems to work if the Circle or RoundRect radius is divisible by 5.0. Clearly this is unexpected behaviour.
suspend fun main() = Korge(
windowSize = Size(512, 512),
backgroundColor = Colors.LIGHTGRAY) {
val sceneContainer = sceneContainer()
sceneContainer.changeTo({ MyScene() })
}
class MyScene : Scene() {
override suspend fun SContainer.sceneMain() {
val rect = roundRect(
size = Size(80.0, 80.0),
radius = RectCorners(4.0),
fill = Colors.GREEN,
stroke = Colors.BLACK,
strokeThickness = 3.0,
)
.centerOnStage()
val circle = circle(
radius = 30f,
fill = Colors.GREEN,
stroke = Colors.BLACK,
strokeThickness = 3.0
)
.centerOnStage()
.alignLeftToRightOf(rect)
val smallCircle = circle(
radius = 28f,
fill = Colors.GREEN,
stroke = Colors.BLACK,
strokeThickness = 3.0
)
.centerOnStage()
.alignLeftToRightOf(circle)
}
}
Thanks for the snippet and the screenshot, that will help 👍