Changeset 776


Ignore:
Timestamp:
01/29/14 10:07:30 (10 years ago)
Author:
jts21
Message:

Fix bug with Text rebuilding, ignore width set on templates, change bullet points to use squares instead of circles (since the circles looked like the link/action marks)

File:
1 edited

Legend:

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

    r720 r776  
    5555        public static String LINE_SEPARATOR = System.getProperty("line.separator");
    5656
    57         public static char[] BULLETS = { '\u2219', '\u2218', '\u2217' };
     57        // public static char[] BULLETS = { '\u2219', '\u2218', '\u2217' };
     58        public static char[] BULLETS = { '\u25AA', '\u25AB', '\u2217' };
    5859
    5960        private static char DEFAULT_BULLET = BULLETS[2];
     
    131132        // text is broken up into lines
    132133        private StringBuffer _text = new StringBuffer();
    133         private boolean _rebuildText = false;
    134134
    135135        private List<TextLayout> _textLayouts = new LinkedList<TextLayout>();
     
    207207
    208208                _maxWidth = width;
    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                rebuild(true);
    213210                invalidateAll();
    214211        }
     
    408405                _text.append(text);
    409406               
    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;
     407                rebuild(true);
    414408        }
    415409
     
    14741468                        width = Float.MAX_VALUE;
    14751469                if (limitWidth) {
    1476                         width = getAbsoluteWidth();
     1470                        if(_maxWidth == null) {
     1471                                width = FrameGraphics.getMaxFrameSize().width - getX();
     1472                        } else {
     1473                                width = getAbsoluteWidth();
     1474                        }
    14771475                        // else if (getMaxWidth() > 0)
    14781476                        // width = Math.max(50, getMaxWidth() - getX()
     
    16691667               
    16701668                        rebuild(true);
    1671                 } else if (_rebuildText || _textLayouts.size() < 1) {
     1669                } else if (_textLayouts.size() < 1) {
    16721670                        clipFrameMargin();
    16731671                        rebuild(true);
    1674                         _rebuildText = false;
    16751672                        // return;
    16761673                }
     
    20612058                Text template = this.copy();
    20622059                template.setID(-1);
     2060                // reset width of global templates so the widths of the items on the settings frames don't cause issues
     2061                // this is in response to the fact that FrameCreator.addItem() sets rightMargin when it adds items
     2062                template.setWidth(null);
    20632063                /*
    20642064                 * The template must have text otherwise the bounds height will be
Note: See TracChangeset for help on using the changeset viewer.