mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35: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:
|
||||
return
|
||||
case opconst.TypePass:
|
||||
op := decodePassOp(encOp.Data)
|
||||
pass = op.Pass
|
||||
pass = encOp.Data[1] != 0
|
||||
case opconst.TypeArea:
|
||||
var op areaOp
|
||||
op.Decode(encOp.Data)
|
||||
@@ -93,7 +92,11 @@ func (q *pointerQueue) collectHandlers(r *ops.Reader, events *handlerEvents, t f
|
||||
dop := ops.DecodeTransform(encOp.Data)
|
||||
t = t.Mul(dop)
|
||||
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{
|
||||
next: node,
|
||||
area: area,
|
||||
@@ -382,23 +385,3 @@ func (op *areaOp) Hit(pos f32.Point) bool {
|
||||
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