Changeset 924


Ignore:
Timestamp:
10/02/14 18:27:27 (10 years ago)
Author:
jts21
Message:

Fix for titles on new frames getting set to the minimum font-size when the template's title is centred

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/FrameIO.java

    r919 r924  
    4848import org.expeditee.items.Item;
    4949import org.expeditee.items.ItemUtils;
     50import org.expeditee.items.Justification;
    5051import org.expeditee.items.PermissionPair;
    5152import org.expeditee.items.Text;
     
    698699                }
    699700
    700                 // do auto shrinking of the title IF not in twin frames mode
     701                // do auto shrinking of the title IF not in twin frames mode and the title is not centred
    701702                Item titleItem = template.getTitleItem();
    702703
    703                 if (!DisplayIO.isTwinFramesOn()) {
     704                if (!DisplayIO.isTwinFramesOn() && !Justification.center.equals(((Text)titleItem).getJustification())) {
    704705                        if ((titleItem.getX() + 1) < template.getNameItem().getX()) {
    705706                                while (titleItem.getSize() > Text.MINIMUM_FONT_SIZE
     
    707708                                                                .getNameItem().getX()) {
    708709                                        titleItem.setSize(titleItem.getSize() - 1);
    709 
    710710                                }
    711711                        } else {
     
    713713                        }
    714714                }
    715 
    716715                // Assign a width to the title.
    717716                titleItem.setRightMargin(template.getNameItem().getX(), true);
Note: See TracChangeset for help on using the changeset viewer.