forked from joejulian/gio
widget: add Draggable.Pos
When the position of the cursor is required while dragging a widget around, the pointer's cannot be tracked as the drag grabs the event priority. Therefore, this patch exposes the drag's current position. Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
@@ -96,3 +96,8 @@ func (d *Draggable) Offer(ops *op.Ops, mime string, data io.ReadCloser) {
|
||||
Data: data,
|
||||
}.Add(ops)
|
||||
}
|
||||
|
||||
// Pos returns the drag position relative to its area.
|
||||
func (d *Draggable) Pos() f32.Point {
|
||||
return d.pos.Add(d.click)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user