mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 17:05:38 +00:00
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,
|
Data: data,
|
||||||
}.Add(ops)
|
}.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