- Timestamp:
- 01/08/14 10:01:57 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/Text.java
r659 r663 131 131 // text is broken up into lines 132 132 private StringBuffer _text = new StringBuffer(); 133 private boolean _rebuildText = false; 133 134 134 135 private List<TextLayout> _textLayouts = new LinkedList<TextLayout>(); … … 206 207 207 208 _maxWidth = width; 208 rebuild(true); 209 // delay rebuilding until the next time we redraw 210 // this makes sure other items will have loaded, so we will be able to rebuild correctly 211 _rebuildText = true; 212 // rebuild(true); 209 213 invalidateAll(); 210 214 } … … 403 407 404 408 _text.append(text); 409 410 // rebuild at next redraw 411 // this makes sure the text item draws correctly upon loading a frame, 412 // and also keeps this method efficient 413 _rebuildText = true; 405 414 } 406 415 … … 1660 1669 1661 1670 rebuild(true); 1662 } else if (_textLayouts.size() < 1) { 1671 } else if (_rebuildText || _textLayouts.size() < 1) { 1672 clipFrameMargin(); 1663 1673 rebuild(true); 1664 // System.out.println("Error: " + _text);1674 _rebuildText = false; 1665 1675 // return; 1666 1676 } … … 2100 2110 String text = _text.toString().trim(); 2101 2111 2112 clipFrameMargin(); 2113 2114 // Show the overlay stuff immediately if this is an overlay item 2115 if (hasLink() && (text.startsWith("@ao") || text.startsWith("@o"))) { 2116 FrameKeyboardActions.Refresh(); 2117 } 2118 } 2119 2120 private void clipFrameMargin() { 2102 2121 if (!hasFixedWidth()) { 2103 2122 int frameWidth = FrameGraphics.getMaxFrameSize().width; … … 2106 2125 * the screen 2107 2126 */ 2108 if (! text.contains(" ")) {2127 if (!_text.toString().contains(" ")) { 2109 2128 Integer width = getWidth(); 2110 2129 if (width == null || width < 0) … … 2114 2133 // setRightMargin(frameWidth, false); 2115 2134 } 2116 }2117 2118 // Show the overlay stuff immediately if this is an overlay item2119 if (hasLink() && (text.startsWith("@ao") || text.startsWith("@o"))) {2120 FrameKeyboardActions.Refresh();2121 2135 } 2122 2136 }
Note:
See TracChangeset
for help on using the changeset viewer.