Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adjust text position so the result looks the same in ImageMagick and …

…GraphicsMagick.
  • Loading branch information...
commit 67d192bed48fd5ca63828064c91e75eac9534de8 1 parent aab2d49
rmagick authored
Showing with 14 additions and 8 deletions.
  1. +14 −8 doc/ex/wet_floor.rb
View
22 doc/ex/wet_floor.rb
@@ -2,25 +2,31 @@
require 'RMagick'
+if Magick::Magick_version =~ /ImageMagick/
+ y = -15
+else
+ y = 1
+end
results = Magick::ImageList.new
img = Magick::Image.new(270, 60)
+img.matte = true
gc = Magick::Draw.new
-gc.annotate(img, 0, 0, 0, -15, "RUBY!") do
+gc.annotate(img, 0, 0, 0, y, "RUBY!") do
gc.fill = '#c00'
gc.stroke = 'black'
gc.stroke_width = 2
gc.font_weight = Magick::BoldWeight
gc.gravity = Magick::SouthGravity
- if RUBY_PLATFORM =~ /mswin32/
- gc.font_family = "Georgia"
- gc.pointsize = 76
- else
- gc.font_family = "times"
- gc.pointsize = 80
- end
+ if RUBY_PLATFORM =~ /mswin32/
+ gc.font_family = "Georgia"
+ gc.pointsize = 76
+ else
+ gc.font_family = "times"
+ gc.pointsize = 80
+ end
end
# Add a little bit of shading
Please sign in to comment.
Something went wrong with that request. Please try again.