Ignore:
Timestamp:
04/13/14 22:33:29 (10 years ago)
Author:
davidb
Message:

Support for bounding box calculation more closely aligned with the actual text drawn on the frame

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/io/flowlayout/XRawItem.java

    r457 r905  
    22
    33import org.expeditee.items.Item;
     4import org.expeditee.items.Text;
    45
    56public class XRawItem extends XItem
     
    1112                this.item = item;
    1213               
    13                 bounding_rect = item.getArea().getBounds();
     14                if (item instanceof Text) {
     15                        // Expecting it to be a text item
     16                        // For it's bounding rectangle, go with the tighter 'PixelBounds' version
     17                       
     18                        Text text_item = (Text)item;
     19                        bounding_rect = text_item.getPixelBoundsUnion();
     20                }
     21                else {
     22                        // Just in case it isn't a text item
     23                        bounding_rect = item.getArea().getBounds();
     24                }
    1425               
    1526        }
Note: See TracChangeset for help on using the changeset viewer.