Class: CooCoo::DataSources::Xournal::Sample

Inherits:
Object
  • Object
show all
Defined in:
lib/coo-coo/data_sources/xournal/document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, width = nil) ⇒ Sample

Returns a new instance of Sample.



264
265
266
267
268
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 264

def initialize(x, y, width = nil)
  @x = x
  @y = y
  @width = width
end

Instance Attribute Details

#widthObject

Returns the value of attribute width.



262
263
264
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 262

def width
  @width
end

#xObject

Returns the value of attribute x.



262
263
264
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 262

def x
  @x
end

#yObject

Returns the value of attribute y.



262
263
264
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 262

def y
  @y
end

Instance Method Details

#scale(sx, sy, sw) ⇒ Object



274
275
276
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 274

def scale(sx, sy, sw)
  self.class.new(x * sx, y * sy, width * sw)
end

#translate(dx, dy) ⇒ Object



270
271
272
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 270

def translate(dx, dy)
  self.class.new(x + dx, y + dy, width)
end