|
@ -22,10 +22,9 @@ const ( |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
type dragger struct { |
|
|
type dragger struct { |
|
|
events chan x.GenericEvent |
|
|
events chan x.GenericEvent |
|
|
startedDrag bool |
|
|
start [2]int16 |
|
|
start [2]int16 |
|
|
end [2]int16 |
|
|
end [2]int16 |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Watch begins the process of dragger watching for drag events
|
|
|
// Watch begins the process of dragger watching for drag events
|
|
@ -50,11 +49,9 @@ func (s *dragger) watch() int { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if generic.GetEventCode() == Pressed { |
|
|
if generic.GetEventCode() == Pressed { |
|
|
s.startedDrag = true |
|
|
|
|
|
s.start = [2]int16{event.EventX, event.EventY} |
|
|
s.start = [2]int16{event.EventX, event.EventY} |
|
|
} else { |
|
|
} else { |
|
|
s.end = [2]int16{event.EventX, event.EventY} |
|
|
s.end = [2]int16{event.EventX, event.EventY} |
|
|
s.startedDrag = false |
|
|
|
|
|
return s.distance() |
|
|
return s.distance() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|