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 @@ -112,24 +112,24 @@ def source
112112 raise NotImplementedError
113113 end
114114
115- def drag ( node , other )
115+ def drag ( node , other , steps )
116116 x1 , y1 = node . find_position
117117 x2 , y2 = other . find_position
118118
119119 mouse . move ( x : x1 , y : y1 )
120120 mouse . down
121- mouse . move ( x : x2 , y : y2 )
121+ mouse . move ( x : x2 , y : y2 , steps : steps )
122122 mouse . up
123123 end
124124
125- def drag_by ( node , x , y )
125+ def drag_by ( node , x , y , steps )
126126 x1 , y1 = node . find_position
127127 x2 = x1 + x
128128 y2 = y1 + y
129129
130130 mouse . move ( x : x1 , y : y1 )
131131 mouse . down
132- mouse . move ( x : x2 , y : y2 )
132+ mouse . move ( x : x2 , y : y2 , steps : steps )
133133 mouse . up
134134 end
135135
Original file line number Diff line number Diff line change @@ -159,12 +159,16 @@ def hover
159159 command ( :hover )
160160 end
161161
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 ] )
164166 end
165167
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 ] )
168172 end
169173
170174 def trigger ( event )
You can’t perform that action at this time.
0 commit comments