class OoxmlParser::DocxShapeSize
Attributes
@return [OOXMLCoordinates] child extent
@return [OOXMLCoordinates] child offset
@return [OOXMLCoordinates] extent info
@return [OOXMLCoordinates] extent info
@return [True, False] is image flipped horizontally
@return [True, False] is image flipped vertically
@return [OOXMLCoordinates] offset info
@return [OoxmlSize] rotation info
Public Instance Methods
Source
# File lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_size.rb, line 26 def parse(node) node.attributes.each do |key, value| case key when 'rot' @rotation = OoxmlSize.new(value.value.to_f, :one_60000th_degree) when 'flipH' @flip_horizontal = attribute_enabled?(value) when 'flipV' @flip_vertical = attribute_enabled?(value) end end node.xpath('*').each do |node_child| case node_child.name when 'off' @offset = OOXMLCoordinates.new(parent: self).parse(node_child, unit: :emu) when 'ext' @extent = OOXMLCoordinates.new(parent: self).parse(node_child, x_attr: 'cx', y_attr: 'cy', unit: :emu) when 'chOff' @child_offset = OOXMLCoordinates.new(parent: self).parse(node_child, unit: :emu) when 'chExt' @child_extent = OOXMLCoordinates.new(parent: self).parse(node_child, x_attr: 'cx', y_attr: 'cy', unit: :emu) end end self end
Parse DocxShapeSize
object @param node [Nokogiri::XML:Element] node to parse @return [DocxShapeSize] result of parsing