- Timestamp:
- 05/10/18 16:04:51 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/MagneticConstraint/Utilities/Line.java
r966 r1102 1 1 package org.expeditee.items.MagneticConstraint.Utilities; 2 2 3 import java.awt.Rectangle;4 3 import java.util.LinkedList; 5 4 5 import org.expeditee.core.bounds.AxisAlignedBoxBounds; 6 6 import org.expeditee.items.Item; 7 7 … … 18 18 19 19 public Line prependLine(final Line line) { 20 final int x = this.getBoundingBox(). x;21 final int width = line.getBoundingBox(). width;20 final int x = this.getBoundingBox().getMinX(); 21 final int width = line.getBoundingBox().getWidth(); 22 22 this.deltaX(width); 23 23 line.setX(x); … … 27 27 28 28 public Line appendLine(final Line line) { 29 final int x = this.getBoundingBox(). x;30 final int width = this.getBoundingBox(). width;29 final int x = this.getBoundingBox().getMinX(); 30 final int width = this.getBoundingBox().getWidth(); 31 31 line.setX(x + width); 32 32 line.setY(this.getFirst().getY()); … … 83 83 } 84 84 85 public RectanglegetBoundingBox() {85 public AxisAlignedBoxBounds getBoundingBox() { 86 86 // final Rectangle rect = new Rectangle(this.getFirst().getX(), this.getFirst().getY(), this.getFirst().getBoundsWidth(), this.getFirst().getBoundsHeight()); 87 87 // for(final Item token : this) 88 88 // rect.add(new Rectangle(token.getX(), token.getY(), token.getBoundsWidth(), token.getBoundsHeight())); 89 89 // return rect; 90 final Rectangle rect = this.getFirst().getArea().getBounds();90 final AxisAlignedBoxBounds rect = this.getFirst().getBoundingBox(); 91 91 for(final Item token : this) 92 rect. add(token.getArea().getBounds());92 rect.combineWith(token.getBoundingBox()); 93 93 return rect; 94 94 }
Note:
See TracChangeset
for help on using the changeset viewer.