Class: Shoes::Swt::ShapePainter

Inherits:
Common::Painter show all
Defined in:
shoes-swt/lib/shoes/swt/shape_painter.rb

Constant Summary

Constants inherited from Common::Painter

Common::Painter::LINECAP

Constants included from Common::Resource

Common::Resource::OPAQUE

Instance Method Summary collapse

Methods inherited from Common::Painter

#after_painted, #draw_setup, #drawing_bottom, #drawing_top, #fill_and_draw, #fill_setup, #initialize, #paint_control, #paint_object, #reset_rotate, #set_rotate

Methods included from Common::Resource

#clip_context_to, #dispose_previous_contexts, #reset_graphics_context, #set_defaults_on_context, #track_graphics_context

Constructor Details

This class inherits a constructor from Shoes::Swt::Common::Painter

Instance Method Details

#before_paintedObject



6
7
8
9
10
11
12
13
14
15
# File 'shoes-swt/lib/shoes/swt/shape_painter.rb', line 6

def before_painted
  return 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

#draw(gc) ⇒ Object



21
22
23
# File 'shoes-swt/lib/shoes/swt/shape_painter.rb', line 21

def draw(gc)
  gc.draw_path(@obj.element)
end

#fill(gc) ⇒ Object



17
18
19
# File 'shoes-swt/lib/shoes/swt/shape_painter.rb', line 17

def fill(gc)
  gc.fill_path(@obj.element)
end