Module: EideticRML::Widgets::HasLocation

Included in:
Label, Shape
Defined in:
lib/erml_widgets.rb

Instance Method Summary collapse

Instance Method Details

#x(value = nil) ⇒ Object



698
699
700
701
702
703
704
# File 'lib/erml_widgets.rb', line 698

def x(value=nil)
  return @x if value.nil?
  return to_units(value, @x) if value.is_a?(Symbol)
  @position = :relative if position == :static and value.respond_to?(:to_str)
  @x = parse_measurement_pts(value, units)
  @x = parent.width - parent.margin_right + @x if @x < 0
end

#y(value = nil) ⇒ Object



706
707
708
709
710
711
712
# File 'lib/erml_widgets.rb', line 706

def y(value=nil)
  return @y if value.nil?
  return to_units(value, @y) if value.is_a?(Symbol)
  @position = :relative if position == :static and value.respond_to?(:to_str)
  @y = parse_measurement_pts(value, units)
  @y = parent.height - parent.margin_bottom + @y if @y < 0
end