widget: [API] separate state changes from Draggable.Layout to Update

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2023-10-05 16:40:21 -05:00
parent fe85136f99
commit 23e44292bb
2 changed files with 36 additions and 47 deletions
+1 -1
View File
@@ -93,7 +93,7 @@ func ExampleDraggable_Layout() {
drag.Layout(gtx, w, w)
// drag must respond with an Offer event when requested.
// Use the drag method for this.
if m, ok := drag.Requested(); ok {
if m, ok := drag.Update(gtx); ok {
drag.Offer(gtx.Ops, m, offer{Data: "hello world"})
}