Sha256: b3db95c78ba8b85bf1eed5abf9a97ee8082f6bb55085a47f9e5a427d5d17d2a4

Contents?: true

Size: 515 Bytes

Versions: 28

Compression:

Stored size: 515 Bytes

Contents

class PSD
  module NodeExporting #:nodoc:
    def export_node(node, path)
      hide_all_nodes
      node.show!
      node.lock_to_origin

      width_difference_factor = @header.cols.to_f / node.width
      height_difference_factor =  @header.rows.to_f / node.height
      @header.cols, @header.rows = node.width, node.height

      node.scale_path_components(width_difference_factor, height_difference_factor)
      export path
    end

    def hide_all_nodes
      tree.descendants.map(&:hide!)
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
bench9000-0.1 vendor/psd.rb/lib/psd/node_exporting.rb
psd-2.1.2 lib/psd/node_exporting.rb
psd-2.1.1 lib/psd/node_exporting.rb
psd-2.1.0 lib/psd/node_exporting.rb
psd-2.0.0 lib/psd/node_exporting.rb
psd-1.5.0 lib/psd/node_exporting.rb
psd-1.4.5 lib/psd/node_exporting.rb
psd-1.4.4 lib/psd/node_exporting.rb
psd-1.4.3 lib/psd/node_exporting.rb
psd-1.4.2 lib/psd/node_exporting.rb
psd-1.4.1 lib/psd/node_exporting.rb
psd-1.4.0 lib/psd/node_exporting.rb
psd-1.3.3 lib/psd/node_exporting.rb
psd-1.3.2 lib/psd/node_exporting.rb
psd-1.3.0 lib/psd/node_exporting.rb
psd-1.2.2 lib/psd/node_exporting.rb
psd-1.2.1 lib/psd/node_exporting.rb
psd-1.2.0 lib/psd/node_exporting.rb
psd-1.1.1 lib/psd/node_exporting.rb
psd-1.1.0 lib/psd/node_exporting.rb