Class: Magick::Draw
- Inherits:
-
Object
- Object
- Magick::Draw
- Defined in:
- lib/gruff/patch/rmagick.rb
Instance Method Summary collapse
-
#annotate_scaled(img, width, height, x, y, text, scale) ⇒ Object
Additional method to scale annotation text since Draw.scale doesn’t.
-
#fill=(fill) ⇒ Object
FIXME(uwe): We should NOT need to implement this method.
- #stroke_opacity(_opacity) ⇒ Object
Instance Method Details
#annotate_scaled(img, width, height, x, y, text, scale) ⇒ Object
Additional method to scale annotation text since Draw.scale doesn’t.
6 7 8 9 10 11 12 13 14 |
# File 'lib/gruff/patch/rmagick.rb', line 6 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 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
25 26 27 28 29 |
# File 'lib/gruff/patch/rmagick.rb', line 25 def fill=(fill) fill = { white: '#FFFFFF' }[fill.to_sym] || fill @draw.fill = Magick4J.ColorDatabase.query_default(fill) self end |
#stroke_opacity(_opacity) ⇒ Object
17 18 19 |
# File 'lib/gruff/patch/rmagick.rb', line 17 def stroke_opacity(_opacity) raise '#stroke_opacity method has different behavior between RMagick and RMagick4J. Should not use this method.' end |