Class: CTioga::TextDimension

Inherits:
Dimension show all
Defined in:
lib/CTioga/dimension.rb

Overview

A dimension that represents text sizes. Absolute has the same meaning, but relative values are relative to default_text_height_x/y

Instance Attribute Summary

Attributes inherited from Dimension

#type, #value

Instance Method Summary collapse

Methods inherited from Dimension

absolute_to_relative, #initialize, #scale!, #to_absolute, #to_relative, update_extensions

Constructor Details

This class inherits a constructor from CTioga::Dimension

Instance Method Details

#to_figure(t, direction) ⇒ Object

Converts the dimension to figure coordinates in the given direction



123
124
125
126
127
128
129
130
# File 'lib/CTioga/dimension.rb', line 123

def to_figure(t, direction)
  if @type == :rel
    return @value * t.send("default_text_height_d#{direction.to_s}")
  else
    return t.send("convert_output_to_figure_d#{direction.to_s}", 
                  @value * 10)
  end
end