Class: Magick::Draw

Inherits:
Object
  • Object
show all
Defined in:
lib/gruff/base.rb

Instance Method Summary collapse

Instance Method Details

#annotate_scaled(img, width, height, x, y, text, scale) ⇒ Object

Additional method to scale annotation text since Draw.scale doesn’t.



1100
1101
1102
1103
1104
1105
1106
1107
1108
# File 'lib/gruff/base.rb', line 1100

def annotate_scaled(img, width, height, x, y, text, scale)
  scaled_width = (width * scale) >= 1 ? (width * scale) : 1
  scaled_height = (height * scale) >= 1 ? (height * scale) : 1

  self.annotate( img,
  scaled_width, scaled_height,
  x * scale, y * scale,
  text)
end