Propagate mouse motion events to boxes

This commit is contained in:
Sasha Koshka 2024-07-27 15:13:49 -04:00
parent d944f6016f
commit bacdd81f60

View File

@ -115,17 +115,18 @@ func (this *Hierarchy) HandleMouseMove (position image.Point) {
for _, dragSet := range this.drags {
for _, box := range dragSet {
if box.handleMouseMove() { break }
dragged = true
}
dragged = true
}
if dragged { return }
// TODO we can hover over multiple boxes at once. however, any way of
// detecting this involves several slice allocations every time we
// process a MouseMove event. perhaps we just ought to suck it up and do
// it.
// it. or perhaps doing *this* is the better way? we may never know.
box := this.boxUnder(position)
if box != nil {
box := this.considerMaskingParents(box)
this.hover(box)
box.handleMouseMove()
}