Rename vars & documentation
This commit is contained in:
parent
87b021749f
commit
8edfc5d591
@ -5,8 +5,8 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
public class BoundingBox {
|
public class BoundingBox {
|
||||||
public Coordinate min;
|
public Coordinate min; // Top-left coordinate of the bounding box
|
||||||
public Coordinate max;
|
public Coordinate max; // Bottom-right coordinate of the bounding box
|
||||||
|
|
||||||
public BoundingBox() {
|
public BoundingBox() {
|
||||||
clear();
|
clear();
|
||||||
|
@ -40,7 +40,7 @@ public abstract class AbstractScaleFigure extends JPanel {
|
|||||||
protected double userScale = 1.0;
|
protected double userScale = 1.0;
|
||||||
protected double scale = -1;
|
protected double scale = -1;
|
||||||
|
|
||||||
// pixel offset from the the subject's origin to the canvas's upper-left-corner.
|
// pixel offset from the subject's origin to the canvas's upper-left-corner.
|
||||||
protected Point originLocation_px = new Point(0,0);
|
protected Point originLocation_px = new Point(0,0);
|
||||||
|
|
||||||
// size of the visible region
|
// size of the visible region
|
||||||
|
@ -54,6 +54,7 @@ public class FinPointFigure extends AbstractScaleFigure {
|
|||||||
private int modID = -1;
|
private int modID = -1;
|
||||||
|
|
||||||
protected BoundingBox finBounds_m = null;
|
protected BoundingBox finBounds_m = null;
|
||||||
|
// Fin parent bounds
|
||||||
protected BoundingBox mountBounds_m = null;
|
protected BoundingBox mountBounds_m = null;
|
||||||
|
|
||||||
protected final List<StateChangeListener> listeners = new LinkedList<>();
|
protected final List<StateChangeListener> listeners = new LinkedList<>();
|
||||||
@ -386,20 +387,20 @@ public class FinPointFigure extends AbstractScaleFigure {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updateCanvasOrigin() {
|
protected void updateCanvasOrigin() {
|
||||||
final int finHeightPx = (int)(finBounds_m.max.y*scale);
|
final int finBottomPy = (int)(finBounds_m.max.y*scale);
|
||||||
final int mountHeightPx = (int)(mountBounds_m.span().y*scale);
|
final int mountHeight = (int)(mountBounds_m.span().y*scale);
|
||||||
// this is non-intuitive: it's an offset _from_ the origin(0,0) _to_ the lower-left of the content --
|
// this is non-intuitive: it's an offset _from_ the origin(0,0) _to_ the lower-left of the content --
|
||||||
// because the canvas is drawn from that lower-left corner of the content, and the fin-front
|
// because the canvas is drawn from that lower-left corner of the content, and the fin-front
|
||||||
// is fixed-- by definition-- to the origin.
|
// is fixed-- by definition-- to the origin.
|
||||||
final int finFrontPx = -(int)(contentBounds_m.getX()*scale); // pixels from left-border to fin-front
|
final int finFrontPx = -(int)(contentBounds_m.getX()*scale); // pixels from left-border to fin-front
|
||||||
final int contentHeightPx = (int)(contentBounds_m.getHeight()*scale);
|
final int contentHeight = (int)(contentBounds_m.getHeight()*scale);
|
||||||
|
|
||||||
originLocation_px.x = borderThickness_px.width + finFrontPx;
|
originLocation_px.x = borderThickness_px.width + finFrontPx;
|
||||||
|
|
||||||
if( visibleBounds_px.height > (contentHeightPx + 2*borderThickness_px.height)){
|
if( visibleBounds_px.height > (contentHeight + 2*borderThickness_px.height)){
|
||||||
originLocation_px.y = getHeight() - mountHeightPx - borderThickness_px.height;
|
originLocation_px.y = getHeight() - mountHeight - borderThickness_px.height;
|
||||||
}else {
|
}else {
|
||||||
originLocation_px.y = borderThickness_px.height + finHeightPx;
|
originLocation_px.y = borderThickness_px.height + finBottomPy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user