@@ -54,7 +54,7 @@ struct Dragger {
54
54
pub mut :
55
55
typ string
56
56
activated bool
57
- widget Draggable = button ()
57
+ widget & Draggable = button ()
58
58
start_x f64
59
59
start_y f64
60
60
pos_x f64
@@ -69,15 +69,15 @@ NB: would like external mechanism only depending on point_inside methods of Widg
69
69
shift key (or other) to activate possible dragging
70
70
*/
71
71
72
- fn drag_register (d Draggable, e & MouseEvent) bool {
72
+ fn drag_register (d & Draggable, e & MouseEvent) bool {
73
73
if shift_key (e.mods) {
74
74
$if drag ? {
75
75
println ('drag ${typeof(w).name} ' )
76
76
}
77
77
mut window := d.get_window ()
78
78
if window.dragger.activated {
79
79
if d.z_index > window.dragger.widget.z_index {
80
- window.dragger.widget = d
80
+ window.dragger.widget = unsafe { d }
81
81
window.dragger.start_x = e.x - d.offset_x
82
82
window.dragger.start_y = e.y - d.offset_y
83
83
// println('drag: ($e.x, $e.y, ${window.dragger.start_x},${window.dragger.start_y})')
@@ -88,7 +88,7 @@ fn drag_register(d Draggable, e &MouseEvent) bool {
88
88
} else {
89
89
window.dragger.activated = true
90
90
window.mouse.start ('blue' )
91
- window.dragger.widget = d
91
+ window.dragger.widget = unsafe { d }
92
92
window.dragger.start_x = e.x - d.offset_x
93
93
window.dragger.start_y = e.y - d.offset_y
94
94
// println('drag: ($e.x, $e.y, ${window.dragger.start_x},${window.dragger.start_y})')
0 commit comments