Closed GoogleCodeExporter closed 9 years ago
proposed fix:
### Eclipse Workspace Patch 1.0
#P phtml
Index: core/src/main/java/edu/umd/cs/piccolo/nodes/PPath.java
===================================================================
--- core/src/main/java/edu/umd/cs/piccolo/nodes/PPath.java (revision 610)
+++ core/src/main/java/edu/umd/cs/piccolo/nodes/PPath.java (working copy)
@@ -311,8 +311,13 @@
if (stroke != null && strokePaint != null) {
g2.setPaint(strokePaint);
- g2.setStroke(stroke);
- g2.draw(path);
+ if (!(stroke instanceof BasicStroke) && "Apple
Inc.".equals(System.getProperty("java.vm.vendor"))) {
+ g2.fill(stroke.createStrokedShape(path));
+ }
+ else {
+ g2.setStroke(stroke);
+ g2.draw(path);
+ }
}
}
Original comment by mr0...@mro.name
on 29 Jul 2009 at 8:58
Could you throw that check into a static method or field, in say PUtil?
Feel free to borrow implementation style from commons-lang SystemUtils:
http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commo
ns/lang/SystemUtils.java?revision=754485
Original comment by heue...@gmail.com
on 29 Jul 2009 at 4:09
sure. Something like PUtil.isAppleVm(); or so.
I always hesitate to expand the API.
Otherwise: code should be platform neutral if anyhow possible. Existence of
such a
method might have led e.g.
http://code.google.com/p/piccolo2d/issues/detail?id=48 to
a quick hack rather than a profound solution.
Original comment by mr0...@mro.name
on 29 Jul 2009 at 4:20
so I favour a private static method for the moment.
Original comment by mr0...@mro.name
on 29 Jul 2009 at 4:22
If we can come up with a profound solution that works on all platforms, I'm all
for it.
If we have to do OS & java version checks (if jdk 1.6+ is not a problem on Mac
OSX,
for instance) then it'd be best to do them robustly with consideration to
SecurityExceptions as in commons-lang.
Then, since PNode is already too big of a class, I would want to add the static
checks to PUtil, even if that means adding to the API.
Or we might add our own SystemUtils or similarly named class package-private to
edu.umd.cs.piccolo.
Original comment by heue...@gmail.com
on 29 Jul 2009 at 4:56
[deleted comment]
[deleted comment]
[deleted comment]
Such a drag:
http://files.getdropbox.com/u/965005/java-puzzle-what%27s%20wrong%20here%3F.png
I wrote this yesterday:
http://code.google.com/p/piccolo2d/source/diff?spec=svn601&r=601&path=/piccolo2d
.java/trunk/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTPath.java
Original comment by mr0...@mro.name
on 29 Jul 2009 at 7:33
Such a fail: http://mro.name/drop/java-puzzle-solved.png
Maybe we'll make PFixedWidthStroke inherit BasicStroke?
Original comment by mr0...@mro.name
on 29 Jul 2009 at 9:17
that's a problem with JDK 1.4.2 that's fixed in 1.5.0
Original comment by mr0...@mro.name
on 29 Jul 2009 at 9:22
Original comment by allain.lalonde
on 30 Oct 2009 at 4:13
Original issue reported on code.google.com by
mr0...@mro.name
on 29 Jul 2009 at 8:49