lib/shoes/swt/shape_painter.rb in shoes-swt-4.0.0.pre12 vs lib/shoes/swt/shape_painter.rb in shoes-swt-4.0.0.rc1
- old
+ new
@@ -1,8 +1,20 @@
# frozen_string_literal: true
+
class Shoes
module Swt
class ShapePainter < Common::Painter
+ def before_painted
+ if @obj.scroll_top_applied != @obj.dsl.parent.scroll_top
+ # Put back what we've already done
+ @obj.transform.translate(0, @obj.scroll_top_applied) if @obj.scroll_top_applied
+
+ # Move it!
+ @obj.transform.translate(0, -@obj.dsl.parent.scroll_top)
+ @obj.scroll_top_applied = @obj.dsl.parent.scroll_top
+ end
+ end
+
def fill(gc)
gc.fill_path(@obj.element)
end
def draw(gc)