Open GoogleCodeExporter opened 9 years ago
Original comment by atdi...@gmail.com
on 8 Nov 2010 at 2:04
Original comment by atdi...@gmail.com
on 21 Nov 2010 at 6:25
Original comment by atdi...@gmail.com
on 21 Nov 2010 at 6:38
I have a more specific analysis of this issue.
* You cannot setWidth() on a PStyledText until after you've given it a document
(see PST.setBounds()).
* You cannot setInsets() on a PStyledText if the inset values produce a total
width margin greater than the width of the PStyledText. (Else you get the
exception reported in this issue.)
To use insets with unconstrained width you must first set the document, then
set the width, then set the insets:
PStyledText t = new PStyledText();
t.setConstrainWidthToTextWidth(false);
t.setDocument(new DefaultStyledDocument());
t.setWidth(50);
t.setInsets(new Insets(10,10,10,10));
So it is possible to get the desired behavior, albeit awkward, undocumented
construction.
I would thus not qualify this as a defect after all but I propose more robust
semantics for future (2.0) behavior:
That is, I propose that PST allows for a width less than the provided insets
with the result being a graceful layout degradation (single character per line
which is what LineBreakMeasurer.nextLayout(0) produces) and not the
LineBreakMeasurer exception we see above.
Original comment by atdi...@gmail.com
on 21 Nov 2010 at 6:54
Original comment by atdi...@gmail.com
on 22 Nov 2010 at 4:37
Based on recent discussion on piccolo2d-user@, I would suggest that PText
receives the same analysis. Making the same calls in a different order
shouldn't result in different behaviour.
See e.g. r1078.
Original comment by heue...@gmail.com
on 14 Dec 2010 at 3:18
I added a comment on the piccolo2d-user thread (goo.gl/BXmlP)... PText is a
slightly different issue and could argue that it is reasonable behavior.
PStyledText on the other hand is throwing an exception if calls are in a
different order, but it could just as easily degrade more gracefully wrt how it
handles Insets that exceed its width...
Original comment by atdi...@gmail.com
on 15 Dec 2010 at 2:32
Original comment by heue...@gmail.com
on 31 Aug 2012 at 8:24
Original comment by heue...@gmail.com
on 31 Aug 2012 at 8:28
Original comment by heue...@gmail.com
on 31 Aug 2012 at 8:30
Original comment by heue...@gmail.com
on 26 Nov 2013 at 9:11
Original issue reported on code.google.com by
atdi...@gmail.com
on 8 Nov 2010 at 1:57