lib/vedeu/output/position.rb in vedeu-0.0.21 vs lib/vedeu/output/position.rb in vedeu-0.0.22

- old
+ new

@@ -10,18 +10,26 @@ def reset new(1, 1).set end end - def initialize(y = nil, x = nil) + def initialize(y = 1, x = 1) @y, @x = y, x end def set [Esc.esc, y, ';', x, 'H'].join end private attr_accessor :y, :x + + def y + @y == 0 ? 1 : @y + end + + def x + @x == 0 ? 1 : @x + end end end