use of com.ait.lienzo.client.core.types.BoundingPoints in project lienzo-core by ahome-it.
the class Geometry method setScaleToFit.
public static final IPrimitive<?> setScaleToFit(final IPrimitive<?> prim, final double wide, final double high) {
final Point2D scale = prim.getScale();
final BoundingBox bbox = prim.getBoundingBox();
if (null != scale) {
final double sx = scale.getX();
final double sy = scale.getY();
if ((sx != 1) || (sy != 1)) {
return setScaleToFit(prim, wide, high, new BoundingPoints(bbox).transform(new Transform().scale(sx, sy)).getBoundingBox());
}
}
return setScaleToFit(prim, wide, high, bbox);
}
use of com.ait.lienzo.client.core.types.BoundingPoints in project lienzo-core by ahome-it.
the class ContainerNode method getBoundingBox.
@Override
public BoundingBox getBoundingBox() {
final BoundingBox bbox = new BoundingBox();
final NFastArrayList<M> list = getChildNodes();
final int size = list.size();
for (int i = 0; i < size; i++) {
final BoundingPoints bpts = list.get(i).getBoundingPoints();
if (null != bpts) {
bbox.add(bpts.getArray());
}
}
return bbox;
}
Aggregations