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
+18
View File
@@ -10,6 +10,8 @@ type PointOptions struct {
StyleID StyleID
Override StyleOverride
HitSlopPx int
hasStyleID bool
}
@@ -44,6 +46,10 @@ func PointWithStyleOverride(ov StyleOverride) PointOpt {
}
}
func PointWithHitSlopPx(px int) PointOpt {
return func(o *PointOptions) { o.HitSlopPx = px }
}
type CircleOpt func(*CircleOptions)
type CircleOptions struct {
@@ -51,6 +57,8 @@ type CircleOptions struct {
StyleID StyleID
Override StyleOverride
HitSlopPx int
hasStyleID bool
}
@@ -81,6 +89,10 @@ func CircleWithStyleOverride(ov StyleOverride) CircleOpt {
}
}
func CircleWithHitSlopPx(px int) CircleOpt {
return func(o *CircleOptions) { o.HitSlopPx = px }
}
type LineOpt func(*LineOptions)
type LineOptions struct {
@@ -88,6 +100,8 @@ type LineOptions struct {
StyleID StyleID
Override StyleOverride
HitSlopPx int
hasStyleID bool
}
@@ -117,3 +131,7 @@ func LineWithStyleOverride(ov StyleOverride) LineOpt {
o.Override = ov
}
}
func LineWithHitSlopPx(px int) LineOpt {
return func(o *LineOptions) { o.HitSlopPx = px }
}