Class: CooCoo::DataSources::Xournal::Sample
- Defined in:
- lib/coo-coo/data_sources/xournal/document.rb
Instance Attribute Summary collapse
-
#width ⇒ Object
Returns the value of attribute width.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
-
#initialize(x, y, width = nil) ⇒ Sample
constructor
A new instance of Sample.
- #scale(sx, sy, sw) ⇒ Object
- #translate(dx, dy) ⇒ Object
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
#width ⇒ Object
Returns the value of attribute width.
262 263 264 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 262 def width @width end |
#x ⇒ Object
Returns the value of attribute x.
262 263 264 |
# File 'lib/coo-coo/data_sources/xournal/document.rb', line 262 def x @x end |
#y ⇒ Object
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 |