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