korlibs / korlibs/korlibs-image
Circles are rendered incorrectly
- Dominant language
- Kotlin
- Stars
- 2
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Circles don't close completely, you can see an opening on the right side.
Code:
```kotlin
import korlibs.image.bitmap.*
import korlibs.image.color.*
import korlibs.korge.*
import korlibs.korge.scene.*
import korlibs.korge.view.*
import korlibs.korge.view.align.*
import korlibs.math.geom.*
suspend fun main() = Korge(windowSize = Size(512, 512), backgroundColor = Colors["#2b2b2b"]) {
val sceneContainer = sceneContainer()
sceneContainer.changeTo { MyScene() }
}
class MyScene : Scene() {
override suspend fun SContainer.sceneMain() {
val cellSize = 128
image(Bitmap32(cellSize, cellSize).context2d {
val margin = 20
stroke(Colors.GREEN, lineWidth = 6) {
circle(Point(cellSize / 2, cellSize / 2), (cellSize - margin) / 2)
}
}) {
centerOn(this@sceneMain)
}
}
}
```
Output:

System:
macOS M1 Sonoma 14.6.1
Korge:
KorGE Forge 2024.2.0.2 (Fenix Edition)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by running the provided Kotlin snippet and inspect the Bitmap32 context2d circle rendering path, especially the circle call inside the stroke block. Confirm the issue on the reported setup, then verify that the rendered circle closes completely without changing the example's intended size or stroke.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100