lib/shoes/swt/arc_painter.rb in shoes-swt-4.0.0.pre12 vs lib/shoes/swt/arc_painter.rb in shoes-swt-4.0.0.rc1
- old
+ new
@@ -1,22 +1,23 @@
# frozen_string_literal: true
+
class Shoes
module Swt
class ArcPainter < Common::Painter
FULL_CIRCLE_DEGREES = 360
def fill(graphics_context)
if @obj.wedge?
graphics_context.fill_arc(@obj.translate_left + @obj.element_left,
- @obj.translate_top + @obj.element_top,
+ @obj.translate_top + drawing_top,
@obj.element_width,
@obj.element_height,
start_angle, sweep)
else
path = ::Swt::Path.new(::Swt.display)
path.add_arc(@obj.translate_left + @obj.element_left,
- @obj.translate_top + @obj.element_top,
+ @obj.translate_top + drawing_top,
@obj.element_width,
@obj.element_height,
start_angle, sweep)
graphics_context.fill_path(path)
end
@@ -24,10 +25,10 @@
def draw(graphics_context)
line_width = graphics_context.get_line_width
if @obj.element_left && @obj.element_top && @obj.element_width && @obj.element_height
graphics_context.draw_arc(@obj.translate_left + @obj.element_left + line_width / 2,
- @obj.translate_top + @obj.element_top + line_width / 2,
+ @obj.translate_top + drawing_top + line_width / 2,
@obj.element_width - line_width,
@obj.element_height - line_width,
start_angle, sweep)
end
end