Selectable elements can now request the selection to be moved

This commit is contained in:
2023-01-16 13:49:32 -05:00
parent 93ab47cdc9
commit 7754679710
5 changed files with 55 additions and 3 deletions

View File

@@ -261,6 +261,20 @@ func (window *Window) childSelectionRequestCallback () (granted bool) {
return true
}
func (window *Window) childSelectionMotionRequestCallback (
direction tomo.SelectionDirection,
) (
granted bool,
) {
if child, ok := window.child.(tomo.Selectable); ok {
if !child.HandleSelection(direction) {
child.HandleDeselection()
}
return true
}
return true
}
func (window *Window) pushRegion (region image.Rectangle) {
if window.xCanvas == nil { panic("whoopsie!!!!!!!!!!!!!!") }
image, ok := window.xCanvas.SubImage(region).(*xgraphics.Image)