feat: hit on primitives

This commit is contained in:
IliaDenisov
2026-03-07 19:28:22 +02:00
parent e4b956232f
commit c076347d70
21 changed files with 1167 additions and 165 deletions
+14 -5
View File
@@ -29,10 +29,14 @@ func (w *World) drawPointInTile(drawer PrimitiveDrawer, plan RenderPlan, td Tile
drawer.AddPoint(float64(px), float64(py), rPx)
// For points we use Fill if fill is configured, otherwise Stroke if stroke is configured.
if lastStyle.FillColor != nil {
fill := alphaNonZero(lastStyle.FillColor)
stroke := alphaNonZero(lastStyle.StrokeColor)
if fill {
drawer.Fill()
} else if lastStyle.StrokeColor != nil {
}
if stroke {
// Stroke must be last when both are present.
drawer.Stroke()
}
}
@@ -58,9 +62,14 @@ func (w *World) drawCircleInTile(drawer PrimitiveDrawer, plan RenderPlan, td Til
drawer.AddCircle(float64(cxPx), float64(cyPx), float64(rPx))
if lastStyle.FillColor != nil {
fill := alphaNonZero(lastStyle.FillColor)
stroke := alphaNonZero(lastStyle.StrokeColor)
if fill {
drawer.Fill()
} else if lastStyle.StrokeColor != nil {
}
if stroke {
// Stroke must be last when both are present.
drawer.Stroke()
}
}