Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Drawing shapes
Drawing shapes [message #649068] Mon, 17 January 2011 08:48
Greg Brown is currently offline Greg Brown
Messages: 16
Registered: December 2010
Junior Member
Last question (for now). Smile In Java2D, a stroke lies half outside of the bounding shape, half inside. For example, let's say I want to draw a 100x50 rectangle at 0, 0 with a stroke width of 1. In Java2D, the stroked shape will actually be drawn at -0.5, -0.5 and will extend to 100.5 and 50.5. If I want the stroke to lie within the bounds of the rectangle, I can draw it at 0.5, 0.5 with a width and height of 99 and 49.

How is this handled in SWT? Since SWT GC coordinates are specified in integers, I imagine that strokes can't fall on non-integral pixel boundaries. How does SWT define the bounds of the stroked shape?

Thanks again,

Previous Topic:Progress Bar Popup
Next Topic:SWT blocking AWT?
Goto Forum:

Current Time: Tue Jul 29 17:03:12 EDT 2014

Powered by FUDForum. Page generated in 0.03244 seconds