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.



1057
1058
1059
1060
1061
1062
1063
1064
1065
# File 'lib/gruff/base.rb', line 1057

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