mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 01:45:36 +00:00
ui/pointer: unexport OpArea.Hit
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -116,7 +116,7 @@ func (op *OpArea) decode(d []byte) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (op *OpArea) Hit(pos f32.Point) HitResult {
|
func (op *OpArea) hit(pos f32.Point) HitResult {
|
||||||
switch op.kind {
|
switch op.kind {
|
||||||
case areaRect:
|
case areaRect:
|
||||||
if 0 <= pos.X && pos.X < float32(op.size.X) &&
|
if 0 <= pos.X && pos.X < float32(op.size.X) &&
|
||||||
|
|||||||
+4
-4
@@ -109,7 +109,7 @@ func (q *Queue) opHit(handlers *[]Key, pos f32.Point) {
|
|||||||
if !ok {
|
if !ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
res := h.area.Hit(pos)
|
res := h.area.hit(pos)
|
||||||
opaque = opaque || res == HitOpaque
|
opaque = opaque || res == HitOpaque
|
||||||
if res != HitNone {
|
if res != HitNone {
|
||||||
*handlers = append(*handlers, n.key)
|
*handlers = append(*handlers, n.key)
|
||||||
@@ -238,7 +238,7 @@ func (q *Queue) Push(e Event) {
|
|||||||
case i == 0:
|
case i == 0:
|
||||||
e.Priority = Foremost
|
e.Priority = Foremost
|
||||||
}
|
}
|
||||||
e.Hit = h.area.Hit(e.Position) != HitNone
|
e.Hit = h.area.hit(e.Position) != HitNone
|
||||||
e.Position = h.transform.InvTransform(e.Position)
|
e.Position = h.transform.InvTransform(e.Position)
|
||||||
h.events = append(h.events, e)
|
h.events = append(h.events, e)
|
||||||
if e.Type == Release {
|
if e.Type == Release {
|
||||||
@@ -256,11 +256,11 @@ func (q *Queue) Push(e Event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a areaIntersection) Hit(p f32.Point) HitResult {
|
func (a areaIntersection) hit(p f32.Point) HitResult {
|
||||||
res := HitNone
|
res := HitNone
|
||||||
for _, area := range a {
|
for _, area := range a {
|
||||||
tp := area.trans.InvTransform(p)
|
tp := area.trans.InvTransform(p)
|
||||||
res = area.area.Hit(tp)
|
res = area.area.hit(tp)
|
||||||
if res == HitNone {
|
if res == HitNone {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user