Sha256: f3f6ea5a89aeaf4c0f22a967382368b7f2d6abba8d10c65d5ebd7ce22cf5c905

Contents?: true

Size: 730 Bytes

Versions: 2

Compression:

Stored size: 730 Bytes

Contents

# frozen_string_literal: true

m = shape({ id: :the_shape, width: 333, left: 130, top: 30, right: 100, height: 399, smooth: 8, color: :yellowgreen, })
m.drag(true)
m.on(:resize) do |event|
  puts event[:dx]
end

m.resize({ size: { min: { width: 90, height: 190 }, max: { width: 300, height: 600 } } }) do |event|
  puts "width is  is #{event[:rect][:width]}"
end

t=text({data: ' click me to unbind resize'})
t.touch(true) do
  t.data('resize unbinded')
  m.resize(:remove)
end

c=circle({left: 99, top: 99, right: 100, height: 99})

c.touch(true) do
  m.resize({ size: { min: { width: 90, height: 190 }, max: { width: 300, height: 600 } } }) do |event|
    puts "ooooooo"
  end
  m.on(:resize) do |event|
    puts 'yes'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
atome-0.5.7.6.0 vendor/assets/application/examples/resize.rb
atome-0.5.7.5.9 vendor/assets/application/examples/resize.rb