Posted by davidcw
on September 26, 2009 at 7:21 AM PDT
This is another question concerning Piet Blok's PBTransform, concerning a scaling issue with JTextComponents.
I know before we use "TransformUI" on JTextComponents, we should call "TransformUI.prepareForJTextComponent()". However, there still appears to be a caret positioning/glyph drawing problem. On certain rows, where the text wraps, selecting portions of the text makes the text shift left or right.
The problem is best visualized: Try running the "A generic Transform" demo from: "http://www.pbjar.org/blogs/jxlayer/jxlayer40/TransformDemo.jnlp". Type " blah blah " (That would be the word "blah" with 1 space infront, between, and trailing) after the last paragraph. So one line of text should be:
"Paragraph 35: aaa bbb ccc ddd eee fff. blah blah "
Now, use the mouse to drag-select the characters "fff. blah". As you drag the mouse, you'll notice that the character positions change. The problem is more pronounced in wrapping JTextComponents with larger widths. Sometimes, the text won't appear wrapped correctly until selected.
I was wondering if someone could think of a fix for this?
- Thank you,
- David W.