moai/moai-dev — Issue #174: setHighlight doesn't always work when using not using a style.
Author: danadrew
Created: 2012-03-09 19:42:01+00:00
State: open
Labels: Bug

See sample: samples / test / textbox-highlight

**Expected:**
setHighlight should highlight the text even if I set up the font using setFont and setTextSize.

**Actual:**
It sometimes does not highlight the words.

**Reproduction Steps:**
1. Set up a text box with some text, use textbox:setFont and textbox:setTextSize instead of setting up a default style.
2. Immediately after that, try to highlight part of the text.
3. The text will not be highlighted.

**Additional Info:**
The highlighting appears to work fine if I use setStyle to create the default style, it only breaks when I use setFont and setTextSize. The highlighting will work if you do it later on, for example in the sample I have it call the exact same setHighlight after you hit the spacebar and it will highlight the text at that time.