mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 09:55:40 +00:00
router: removed unnecessary checks.
Signed-off-by: pierre <pierre.curto@gmail.com>
This commit is contained in:
+6
-23
@@ -76,8 +76,7 @@ func (q *pointerQueue) collectHandlers(r *ops.Reader, events *handlerEvents, t f
|
|||||||
case opconst.TypePop:
|
case opconst.TypePop:
|
||||||
return
|
return
|
||||||
case opconst.TypePass:
|
case opconst.TypePass:
|
||||||
op := decodePassOp(encOp.Data)
|
pass = encOp.Data[1] != 0
|
||||||
pass = op.Pass
|
|
||||||
case opconst.TypeArea:
|
case opconst.TypeArea:
|
||||||
var op areaOp
|
var op areaOp
|
||||||
op.Decode(encOp.Data)
|
op.Decode(encOp.Data)
|
||||||
@@ -93,7 +92,11 @@ func (q *pointerQueue) collectHandlers(r *ops.Reader, events *handlerEvents, t f
|
|||||||
dop := ops.DecodeTransform(encOp.Data)
|
dop := ops.DecodeTransform(encOp.Data)
|
||||||
t = t.Mul(dop)
|
t = t.Mul(dop)
|
||||||
case opconst.TypePointerInput:
|
case opconst.TypePointerInput:
|
||||||
op := decodePointerInputOp(encOp.Data, encOp.Refs)
|
op := pointer.InputOp{
|
||||||
|
Tag: encOp.Refs[0].(event.Tag),
|
||||||
|
Grab: encOp.Data[1] != 0,
|
||||||
|
Types: pointer.Type(encOp.Data[2]),
|
||||||
|
}
|
||||||
q.hitTree = append(q.hitTree, hitNode{
|
q.hitTree = append(q.hitTree, hitNode{
|
||||||
next: node,
|
next: node,
|
||||||
area: area,
|
area: area,
|
||||||
@@ -382,23 +385,3 @@ func (op *areaOp) Hit(pos f32.Point) bool {
|
|||||||
panic("invalid area kind")
|
panic("invalid area kind")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func decodePointerInputOp(d []byte, refs []interface{}) pointer.InputOp {
|
|
||||||
if opconst.OpType(d[0]) != opconst.TypePointerInput {
|
|
||||||
panic("invalid op")
|
|
||||||
}
|
|
||||||
return pointer.InputOp{
|
|
||||||
Tag: refs[0].(event.Tag),
|
|
||||||
Grab: d[1] != 0,
|
|
||||||
Types: pointer.Type(d[2]),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func decodePassOp(d []byte) pointer.PassOp {
|
|
||||||
if opconst.OpType(d[0]) != opconst.TypePass {
|
|
||||||
panic("invalid op")
|
|
||||||
}
|
|
||||||
return pointer.PassOp{
|
|
||||||
Pass: d[1] != 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user