Open GoogleCodeExporter opened 9 years ago
Shouldn't a BasicStroke(0) yield a stroke that is zero pixels wide? Maybe you
need to create a BasicStroke(1) to get a stroke of 1 pixel wide.
Original comment by samrr...@gmail.com
on 23 Jul 2011 at 4:35
In the Developer's FAQ http://www.piccolo2d.org/learn/dev-faq.html
section "Why is my app so slow?", it states as follows:
"...., If you need to render the strokes, you could try setting the stroke
width to zero, which has the effect of always drawing a one-pixel wide stroke.
...."
And it brings very significant performance improvement using BasicStroke(0).
The bug occurs when either x1 == x2, or y1 == y2 in the case of
PPath.createLine(x1, y1, x2, y2);
Original comment by v11...@gmail.com
on 24 Jul 2011 at 3:36
I can confirm the bug with my system
* Piccolo2d.java 1.3.1,
* java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.3) (fedora-59.1.10.3.fc15-i386)
OpenJDK Server VM (build 20.0-b11, mixed mode)
* Fedora 15 2.6.40.6-0.fc15.i686
If x1!=x2 or y1!=y2 then a one pixel width line is drawn in every zoom level,
for stroke width zero. Attached is a test program to show the issue.
Original comment by funny...@googlemail.com
on 22 Oct 2011 at 4:10
Attachments:
Is this a Piccolo2D bug or an AWT one? I don't see any mention of 1-pixel wide
stroke width with BasicStroke(0) in the JDK javadocs.
Original comment by heue...@gmail.com
on 26 Oct 2011 at 3:12
"If you need to render the strokes, you could try setting the stroke width to
zero, which has the effect of always drawing a one-pixel wide stroke."
This is true for the Win7/Java1.6.27 system I've tested it on, but afaik
Piccolo doesn't have logic that ensures this, so it would be a side effect of
what the JDK does. If the JDK doesn't document this as a contract, then it must
be inadvertent or a bug and not to be relied on.
We might want to remove that comment from the developer faq.
Original comment by atdi...@gmail.com
on 1 Nov 2011 at 11:28
Adding example
$ svn commit -m "Issue 221 ; adding ZeroWidthStrokeBug to examples.issues" .
Committed revision 1169.
Original comment by heue...@gmail.com
on 31 Aug 2012 at 4:59
Original comment by heue...@gmail.com
on 31 Aug 2012 at 8:29
The attached java examples draws vertical and horizontal lines with
BasicStroke(0). It works correctly. I think the problem is not in java itself.
Original comment by v11...@gmail.com
on 9 Dec 2012 at 6:12
Attachments:
Original issue reported on code.google.com by
v11...@gmail.com
on 23 Jul 2011 at 10:54