Currently a hidden ```TEXTAREA``` is created for every IText instance and remain in the DOM forever.
This patch creates the required textarea on demand in ```enterEditing``` and destroys it in ```exitEditing```
This prevents multiple Textareas from hanging around in the DOM which can cause slowdowns in complex scenes with lots of IText instances.
This commit modifies the ```mouseUp ```handler to fix ```enterEditing``` behaviour, while maintaining the ability to fire ```enterEditing()``` programmatically
Previously RenderSelection performed a fillRect() command for every character. This resulted in poor performance on large bodies of text. This rewrite calculates the selection box for each line of text and draws a single rectangle for each line, dramatically improving performance.
This clamps the click cursor placement so that clicking to the left of a short first line of centered/right aligned text positions the cursor to the left of the first character in the line....
Previously in that instance it would move to the left boundary instead
Fixes selectWord so that double clicking at the end of a word (just after the last character in the left half of the space) selects the previous word. Again this is MS Word behaviour.
Oops... thats better! :)
This way we get all the responsiveness benefits of setting the cursor position on mousedown but can still actually move the objects!
Setting cursor restart delay to 0 improves responsiveness when beginning drag selection, works inline with my previous two commits for selectLine/selectWord
Restarting cursor rendering using initDelayedCursor(true) in selectWord and selectLine improves user perceived responsiveness and provides an accurate reproduction of MS Word behaviour