feat: hit on primitives
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user