File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -121,24 +121,24 @@ def source
121
121
raise NotImplementedError
122
122
end
123
123
124
- def drag ( node , other )
124
+ def drag ( node , other , steps )
125
125
x1 , y1 = node . find_position
126
126
x2 , y2 = other . find_position
127
127
128
128
mouse . move ( x : x1 , y : y1 )
129
129
mouse . down
130
- mouse . move ( x : x2 , y : y2 )
130
+ mouse . move ( x : x2 , y : y2 , steps : steps )
131
131
mouse . up
132
132
end
133
133
134
- def drag_by ( node , x , y )
134
+ def drag_by ( node , x , y , steps )
135
135
x1 , y1 = node . find_position
136
136
x2 = x1 + x
137
137
y2 = y1 + y
138
138
139
139
mouse . move ( x : x1 , y : y1 )
140
140
mouse . down
141
- mouse . move ( x : x2 , y : y2 )
141
+ mouse . move ( x : x2 , y : y2 , steps : steps )
142
142
mouse . up
143
143
end
144
144
Original file line number Diff line number Diff line change @@ -159,12 +159,16 @@ def hover
159
159
command ( :hover )
160
160
end
161
161
162
- def drag_to ( other )
163
- command ( :drag , other . node )
162
+ def drag_to ( other , **options )
163
+ options [ :steps ] ||= 1
164
+
165
+ command ( :drag , other . node , options [ :steps ] )
164
166
end
165
167
166
- def drag_by ( x , y )
167
- command ( :drag_by , x , y )
168
+ def drag_by ( x , y , **options )
169
+ options [ :steps ] ||= 1
170
+
171
+ command ( :drag_by , x , y , options [ :steps ] )
168
172
end
169
173
170
174
def trigger ( event )
You can’t perform that action at this time.
0 commit comments