Changeset 1511 for trunk/src/org/expeditee/items/Item.java
- Timestamp:
- 02/19/20 10:44:38 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/Item.java
r1509 r1511 2740 2740 } 2741 2741 2742 public void setRightMargin(int i, boolean fixWidth) 2743 { 2744 int newWidth = i - getX() - Item.MARGIN_LEFT; 2745 if (newWidth < 0) newWidth = 0; 2746 2747 if (!fixWidth) { 2748 newWidth *= -1; 2749 } 2750 2751 setWidth(newWidth); 2742 public void setRightMargin(int rightEdgeToFitTo, boolean fixWidth) 2743 { 2744 int itemXLeft = getX(); 2745 int adjustedRightEdgeToFitTo = rightEdgeToFitTo - Item.MARGIN_LEFT; 2746 2747 if (itemXLeft < adjustedRightEdgeToFitTo) { 2748 int newWidth = adjustedRightEdgeToFitTo - itemXLeft; 2749 2750 if (!fixWidth) { 2751 newWidth *= -1; 2752 } 2753 2754 setWidth(newWidth); 2755 } else if (fixWidth) { 2756 System.err.println( 2757 "Item::setRightMargin() called to set right margin outside of writable area but with fixWidth set to true."); 2758 System.err.println(this); 2759 } 2752 2760 } 2753 2761 … … 3655 3663 if (anchor != null) { 3656 3664 anchorConstraints(); 3657 setX(DisplayController.getFramePaintArea().getMaxX() - anchor - getBoundsWidth()); 3665 int width = Math.abs(getBoundsWidth()); 3666 //System.err.println("Item::setAnchorRight::Text Content= " + getText() + "; width=" + width); 3667 setX(DisplayController.getFramePaintArea().getMaxX() - anchor - width); 3658 3668 } 3659 3669
Note:
See TracChangeset
for help on using the changeset viewer.