use of net.sf.latexdraw.models.interfaces.shape.IPoint in project latexdraw by arnobl.
the class LAbstractGrid method getTopRightPoint.
@Override
public IPoint getTopRightPoint() {
final IPoint pos = getPosition();
final double step = getStep();
// FIXME strange: different from getTopLeftPoint and co. but works for scale.
return ShapeFactory.INST.createPoint(pos.getX() + step * (getGridEndX() - getGridStartX()), pos.getY() - step * (getGridEndY() - getGridStartY()));
}
use of net.sf.latexdraw.models.interfaces.shape.IPoint in project latexdraw by arnobl.
the class LAbstractGrid method mirrorHorizontal.
@Override
public void mirrorHorizontal(final double x) {
if (MathUtils.INST.isValidCoord(x)) {
final IPoint bl = points.get(0).horizontalSymmetry(x);
final IPoint br = getBottomRightPoint().horizontalSymmetry(x);
points.get(0).setPoint(br.getX() < bl.getX() ? br.getX() : bl.getX(), br.getY());
}
}
use of net.sf.latexdraw.models.interfaces.shape.IPoint in project latexdraw by arnobl.
the class LAbstractGrid method mirrorVertical.
@Override
public void mirrorVertical(final double y) {
if (MathUtils.INST.isValidCoord(y)) {
final IPoint bl = points.get(0).verticalSymmetry(y);
final IPoint tl = getTopLeftPoint().verticalSymmetry(y);
points.get(0).setPoint(bl.getX(), bl.getY() > tl.getY() ? bl.getY() : tl.getY());
}
}
use of net.sf.latexdraw.models.interfaces.shape.IPoint in project latexdraw by arnobl.
the class LGroupShape method getFullBottomRightPoint.
@Override
default IPoint getFullBottomRightPoint() {
final double gap = getBorderGap();
final IPoint br = getBottomRightPoint();
br.translate(gap, gap);
return br;
}
use of net.sf.latexdraw.models.interfaces.shape.IPoint in project latexdraw by arnobl.
the class LLine method getTopLeftPoint.
@Override
public IPoint getTopLeftPoint() {
final IPoint pt1 = getPoint1();
final IPoint pt2 = getPoint2();
return ShapeFactory.INST.createPoint(pt1.getX() < pt2.getX() ? pt1.getX() : pt2.getX(), pt1.getY() < pt2.getY() ? pt1.getY() : pt2.getY());
}
Aggregations