Method: PSD::Node::Base#initialize
- Defined in:
- lib/psd/node.rb
#initialize(layer, parent = nil) ⇒ Base
Returns a new instance of Base.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/psd/node.rb', line 29 def initialize(layer, parent = nil) @layer = layer @layer.node = self @parent = parent @children = [] @id = begin layer.layer_id.id rescue nil end @force_visible = nil @top = @layer.top.to_i @bottom = @layer.bottom.to_i @left = @layer.left.to_i @right = @layer.right.to_i @top_offset = 0 @left_offset = 0 end |