Sha256: 11e65f3dc3568173868a3ba2b66d38eafc7ddce69ed98ad2d863ae4f02a24791

Contents?: true

Size: 964 Bytes

Versions: 2

Compression:

Stored size: 964 Bytes

Contents

require_relative 'ooxml_shift'
module OoxmlParser
  class TransformEffect
    attr_accessor :offset, :extents, :child_offset, :child_extent

    def initialize(offset = nil, extents = nil)
      @offset = offset
      @extents = extents
    end

    def self.parse(transform_effect_node)
      transform_effect = TransformEffect.new
      transform_effect_node.xpath('*').each do |transform_effect_node_child|
        case transform_effect_node_child.name
        when 'ext'
          transform_effect.extents = OOXMLShift.parse(transform_effect_node_child, 'cx', 'cy')
        when 'off'
          transform_effect.offset = OOXMLShift.parse(transform_effect_node_child)
        when 'chOff'
          transform_effect.child_offset = OOXMLShift.parse(transform_effect_node_child)
        when 'chExt'
          transform_effect.child_extent = OOXMLShift.parse(transform_effect_node_child, 'cx', 'cy')
        end
      end
      transform_effect
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ooxml_parser-0.1.2 lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties/transform_effect.rb
ooxml_parser-0.1.1 lib/ooxml_parser/common_parser/common_data/alternate_content/shape/shape_properties/transform_effect.rb