lib/gruffy/base.rb in gruffy-0.0.5 vs lib/gruffy/base.rb in gruffy-0.0.6
- old
+ new
@@ -861,24 +861,24 @@
else # @label_truncation_style is :absolute (default)
label_text = label_text[0 .. (@label_max_size - 1)]
end
end
- y_offset += ((label_text.size - different_size) * 4) + 10 if @label_rotation.preset?
+ y_offset += ((label_text.size - different_size) * 4) + 10 if @label_rotation.present?
if x_offset >= @graph_left && x_offset <= @graph_right
- @d.rotation = (@label_rotation.to_i * (-1)) if @label_rotation.preset?
+ @d.rotation = (@label_rotation.to_i * (-1)) if @label_rotation.present?
@d.fill = @font_color
@d.font = @font if @font
@d.stroke('transparent')
@d.font_weight = NormalWeight
@d.pointsize = scale_fontsize(@marker_font_size)
@d.gravity = NorthGravity
@d = @d.annotate_scaled(@base_image,
1.0, 1.0,
x_offset, y_offset,
label_text, @scale)
- @d.rotation = @label_rotation.to_i if @label_rotation.preset?
+ @d.rotation = @label_rotation.to_i if @label_rotation.present?
end
@labels_seen[index] = 1
debug { @d.line 0.0, y_offset, @raw_columns, y_offset }
end
end
@@ -952,10 +952,10 @@
when :topright_bottomleft
gradient_fill = GradientFill.new(0, 0, 100, 100, bottom_color, top_color)
else
gradient_fill = GradientFill.new(0, 0, 100, 0, top_color, bottom_color)
end
- @rows += 55 if @label_rotation.preset?
+ @rows += 55 if @label_rotation.present?
Image.new(@columns, @rows, gradient_fill)
end
# Use with a theme to use an image (800x600 original) background.
def render_image_background(image_path)