use of com.xenoage.utils.math.geom.Rectangle2f in project Zong by Xenoage.
the class PathSymbolGraphicAttribute method getBounds.
@Override
public Rectangle2D getBounds() {
Rectangle2f f = symbol.getBoundingRect();
f.scale(scaling);
return new Rectangle2D.Float(f.x1(), f.y1(), f.width(), f.height());
}
use of com.xenoage.utils.math.geom.Rectangle2f in project Zong by Xenoage.
the class FrameRenderer method getLocalRect.
protected Rectangle2f getLocalRect(Frame frame) {
float x = frame.getSize().width;
float y = frame.getSize().height;
Rectangle2f rect = new Rectangle2f(-x / 2, -y / 2, x, y);
return rect;
}
use of com.xenoage.utils.math.geom.Rectangle2f in project Zong by Xenoage.
the class ChordStamper method getNoteheadXMm.
// TIDY
private float getNoteheadXMm(float xMm, float scaling, StaffStamping staff, Symbol symbol) {
float ret = xMm;
Rectangle2f bounds = symbol.getBoundingRect().scale(scaling);
float interlineSpace = staff.is;
float lineWidth = staff.getLineWidthMm();
ret += (bounds.size.width / 2) * interlineSpace - lineWidth / 2;
return ret;
}
use of com.xenoage.utils.math.geom.Rectangle2f in project Zong by Xenoage.
the class FlagsStamping method getBoundingShape.
@Override
public Shape getBoundingShape() {
if (cachedBoundingShape != null)
return cachedBoundingShape;
// compute bounding shape
float flagsDistance = getFlagsDistance(flagsDirection, scaling);
float interlineSpace = parentStaff.is;
for (int i = 0; i < flagsCount; i++) {
Rectangle2f bounds = symbol.getBoundingRect().scale(scaling * interlineSpace);
if (flagsDirection == FlagsDirection.Up) {
bounds = bounds.move(0, -bounds.size.height);
}
bounds = bounds.move(0, -i * flagsDistance * interlineSpace);
if (cachedBoundingShape == null)
cachedBoundingShape = bounds;
else
cachedBoundingShape = cachedBoundingShape.extend(bounds);
}
cachedBoundingShape.move(position.xMm, parentStaff.computeYMm(position.lp));
return cachedBoundingShape;
}
use of com.xenoage.utils.math.geom.Rectangle2f in project Zong by Xenoage.
the class StaffSymbolStamping method getBoundingShape.
@Override
public Rectangle2f getBoundingShape() {
Rectangle2f bounds = symbol.getBoundingRect();
bounds = bounds.scale(scaling * parentStaff.is);
bounds = bounds.move(position.xMm, parentStaff.computeYMm(position.lp));
return bounds;
}
Aggregations