Changeset 635


Ignore:
Timestamp:
12/17/13 17:05:46 (11 years ago)
Author:
jts21
Message:

Fix crash (infinite loop) caused by trying to wrap a text item at the edge of the frame when it is too large to wrap

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/items/Text.java

    r632 r635  
    14671467               
    14681468                _lineBreaker.setPosition(0);
     1469                boolean requireNextWord = false;
    14691470
    14701471                // --- Get the output of the LineBreakMeasurer and store it in a
    14711472                while (_lineBreaker.getPosition() < _text.length()) {
    14721473                       
    1473                         layout = _lineBreaker.nextLayout(width, _text.length(), true);
     1474                        if(_autoWrap || ExperimentalFeatures.AutoWrap) {
     1475                                requireNextWord = width < FrameGraphics.getMaxFrameSize().width - getX();
     1476                        }
     1477                       
     1478                        layout = _lineBreaker.nextLayout(width, _text.length(), requireNextWord);
    14741479                       
    14751480                        // lineBreaker does not break on newline
     
    14831488                                if (_text.charAt(i) == '\n') {// || c == '\t'){
    14841489                                        _lineBreaker.setPosition(start);
    1485                                         layout = _lineBreaker.nextLayout(width, i, true);
     1490                                        layout = _lineBreaker.nextLayout(width, i, requireNextWord);
    14861491                                        break;
    14871492                                }
Note: See TracChangeset for help on using the changeset viewer.