vendor/assets/application/examples/drag.rb in atome-0.5.7.3.0 vs vendor/assets/application/examples/drag.rb in atome-0.5.7.3.1
- old
+ new
@@ -1,6 +1,7 @@
# frozen_string_literal: true
+
a=box({width: 666, height: 777, color: :orange})
b = box({ left: 666, color: :blue, smooth: 6, id: :the_box2, depth: 1 , top: 66})
cc=circle({color: :red, left: 0, top: 0})
clone = ""
b.drag(:start) do
@@ -14,12 +15,10 @@
b.color(:purple)
b.height=b.height+100
clone.delete(true)
end
-
-
b.drag(:locked) do |event|
dx = event[:dx]
dy = event[:dy]
x = (clone.left || 0) + dx.to_f
y = (clone.top || 0) + dy.to_f
@@ -27,10 +26,9 @@
clone.top(y)
puts "x: #{x}"
puts "y: #{y}"
end
cc.drag({ restrict: {max:{ left: 240, top: 190}} }) do |event|
-
end
c=circle