Class: Magick::Draw

Inherits:
Object
  • Object
show all
Defined in:
lib/gruffy/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.



1183
1184
1185
1186
1187
1188
1189
1190
1191
# File 'lib/gruffy/base.rb', line 1183

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.gsub('%', '%%'))
end

#fill=(fill) ⇒ Object

FIXME(uwe): We should NOT need to implement this method.

Remove this method as soon as RMagick4J Issue #16 is fixed.
https://github.com/Serabe/RMagick4J/issues/16


1197
1198
1199
1200
1201
# File 'lib/gruffy/base.rb', line 1197

def fill=(fill)
  fill = {:white => '#FFFFFF'}[fill.to_sym] || fill
  @draw.fill = Magick4J.ColorDatabase.query_default(fill)
  self
end