[piccolo2d-dev] Issue 189 in piccolo2d: Provide advanced graphical options under SWT

2010-08-21 Thread piccolo2d

Status: New
Owner: 

New issue 189 by berthold...@bdaum.de: Provide advanced graphical options  
under SWT

http://code.google.com/p/piccolo2d/issues/detail?id=189

Wishlist:
1. Line width
2. Transparency
3. Antialiasing

Although it is possible to add most of these options by subclassing,
it would be nice to offer them out of the box.
For transparency, a change in PSWTGraphics2D (1.3) is necessary, though  
(bd1):


public void setTransparency(float transparency) { // bd1
gc.setAlpha((int) (transparency*255f));
}

I have attached the classes ZPSWTCanvas and ZPSWTPath that add options for  
linewidth, transparency, and antialiasing


Attachments:
ZPSWTCanvas.java  1.4 KB
ZPSWTPath.java  1.6 KB

--
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en


[piccolo2d-dev] Re: Issue 187 in piccolo2d: general shapes are not filled correctly under SWT

2010-08-21 Thread piccolo2d


Comment #1 on issue 187 by berthold...@bdaum.de: general shapes are not  
filled correctly under SWT

http://code.google.com/p/piccolo2d/issues/detail?id=187

Fix is for version 1.3

--
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en


[piccolo2d-dev] Issue 188 in piccolo2d: wrong line width when drawing general shapes under SWT

2010-08-21 Thread piccolo2d

Status: New
Owner: 

New issue 188 by berthold...@bdaum.de: wrong line width when drawing  
general shapes under SWT

http://code.google.com/p/piccolo2d/issues/detail?id=188

What steps will reproduce the problem?
1.Define a PSWTPath with a polyline
2.Enlarge the scaling by a large scaling factor
3.

The line becomes too fat when the drawing is enlarged. Setting the  
linewidth to the SWT graphic context in SWTGraphics2D before drawing fixes  
the problem (bd3):


public void drawPath(final Path p) {
gc.setLineWidth((int) (lineWidth + 0.5)); // bd3
gc.setTransform(swtTransform);
gc.drawPath(p);
gc.setTransform(null);
}



What version of the product are you using?

1.3




--
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en


[piccolo2d-dev] Issue 187 in piccolo2d: general shapes are not filled correctly under SWT

2010-08-21 Thread piccolo2d

Status: New
Owner: 

New issue 187 by berthold...@bdaum.de: general shapes are not filled  
correctly under SWT

http://code.google.com/p/piccolo2d/issues/detail?id=187

What steps will reproduce the problem?
1.Create a PSWTPath with a polyline
2.Set different stroke and background colors
3.Observe the result

Obviously, the fill(final Shape s) method in SWTGraphics2D calls the wrong  
sub-method. The fix (bd2) is:


...
Path p = (Path) SHAPE_CACHE.get(s);
if (p == null) {
p = pathIterator2Path(s.getPathIterator(null));
SHAPE_CACHE.put(s, p);
}
//drawPath(p);
fillPath(p); // bd2
}
}


--
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en