Sha256: 03cc39d6b4e1af4babe80f4175fefabbeecc25c079033163b40cc8cb1b870716

Contents?: true

Size: 1.91 KB

Versions: 29

Compression:

Stored size: 1.91 KB

Contents

# frozen_string_literal: true

# new({ particle: :duplicate, store: false }) do |params|
#   if @duplicate
#     copy_number = @duplicate.length
#   else
#     copy_number = 0
#   end
#
#   new_atome_id = "#{@id}_copy_#{copy_number}"
#   new_atome = Atome.new({ type: @type, renderers: @renderers, id: new_atome_id })
#
#   attached_atomes = []
#   attached_found = attached.dup
#   particles_found = instance_variables.dup
#
#   particles_found.delete(:@history)
#   particles_found.delete(:@callback)
#   particles_found.delete(:@duplicate)
#   particles_found.delete(:@touch_code)
#   # touch_code=instance_variable_get('@touch_code')
#   particles_found.delete(:@html)
#   particles_found.delete(:@attached)
#   particles_found.delete(:@id)
#   params[:id] = new_atome_id
#   attached_found.each do |child_id_found|
#     child_found = grab(child_id_found)
#     if child_found
#       new_child = child_found.duplicate({})
#       attached_atomes << new_child.id
#     end
#   end
#   particles_found.each do |particle_found|
#     particle_name = particle_found.to_s.sub('@', '')
#     particle_content = self.send(particle_name)
#     new_atome.set(particle_name => particle_content)
#     # new_atome.instance_variable_set('@touch_code',touch_code)
#   end
#   params[:attached] = attached_atomes
#
#   if params.instance_of? Hash
#     params.each do |k, v|
#       new_atome.send(k, v)
#     end
#   end
#
#   @duplicate ||= {}
#   @duplicate[new_atome_id] = new_atome
#   new_atome
# end
#
# new({ after: :duplicate }) do |params|
#   @duplicate[@duplicate.keys[@duplicate.keys.length - 1]]
# end
# c=circle
# c.color({red: 1, id: :titi})
# # b=box({apply: [:titi], left: 123})


b = circle({ id: :the_circle })
b.text(:hello)
bb = b.duplicate({  width: 33, left: 234, top: 222 })
bb.color(:red)
wait 1 do
bb2 = b.duplicate({ width: 33, left: 12, top: 99 })
bb3 = b.duplicate({ width: 33, left: 444 })
bb3.color(:green)
bb2.color(:orange)
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
atome-0.5.7.3.6 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.3.5 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.3.3 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.3.2 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.3.1 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.3.0 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.1.8 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.1.7 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.1.0 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.0.7 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.0.5 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.0.4 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.0.3 vendor/assets/application/examples/duplicate.rb
atome-0.5.7.0.2 vendor/assets/application/examples/duplicate.rb
atome-0.5.6.8.7 vendor/assets/application/examples/duplicate.rb
atome-0.5.6.8.6 vendor/assets/application/examples/duplicate.rb
atome-0.5.6.8.5 vendor/assets/application/examples/duplicate.rb
atome-0.5.6.8.3 vendor/assets/application/examples/duplicate.rb
atome-0.5.6.7.8 vendor/assets/application/examples/duplicate.rb
atome-0.5.6.7.7 vendor/assets/application/examples/duplicate.rb