Caret issues when setting vertical align
- December 2, 2009
- 2 replies
- 793 views
Hey everyone,
I'm just starting to dig into the Text Layout Framework and have noticed a really weird bug. The test seems really basic so I'm bewildered as to why it would ever be released with the bug in it, so I'm hoping it's just my settings or something. I'm compiling with the Flex 3.3 SDK and I've included the textLayout.swc in my project.
The bug is essentially this: click in the second line of text and the caret is positioned and sized correctly. Now click the first line of text and the caret is positioned quite far below both lines of text. Here's the test:
package {
import flash.display.Sprite;
import flashx.textLayout.container.ContainerController;
import flashx.textLayout.conversion.TextConverter;
import flashx.textLayout.edit.EditManager;
import flashx.textLayout.elements.TextFlow;
import flashx.textLayout.formats.VerticalAlign;
public class FRE3 extends Sprite
{
protected var textFlow:TextFlow;
protected var controller:ContainerController;
protected var editManager:EditManager;
public function FRE3()
{
var markup:XML = <TextFlow xmlns='http://ns.adobe.com/textLayout/2008'><p><span>Hello, World</span></p><p><span>Wo</span><span>ot</span></p></TextFlow>;
textFlow = TextConverter.importToFlow(markup, TextConverter.TEXT_LAYOUT_FORMAT);
textFlow.verticalAlign = VerticalAlign.MIDDLE;
controller = new ContainerController(this, 100, 100);
textFlow.flowComposer.addController(controller);
textFlow.flowComposer.updateAllControllers();
editManager = new EditManager();
textFlow.interactionManager = editManager;
}
}
}
