Пример #1
0
 private Rectangle scaleRectangle(Rectangle rect, float scaleX, float scaleY) {
   Rectangle scaled = new Rectangle();
   scaled.setX(rect.getX() * scaleX);
   scaled.setY(rect.getY() * scaleY);
   scaled.setWidth(rect.getWidth() * scaleX);
   scaled.setHeight(rect.getHeight() * scaleY);
   return scaled;
 }
Пример #2
0
 public static Rectangle loadRectangleFromXmlOptSize(Node node) {
   Rectangle rect = new Rectangle();
   rect.setX(Integer.parseInt(XmlHelper.loadAttribute(node, "X")));
   rect.setY(Integer.parseInt(XmlHelper.loadAttribute(node, "Y")));
   rect.setWidth(Integer.parseInt(XmlHelper.loadAttribute(node, "Width", "0")));
   rect.setHeight(Integer.parseInt(XmlHelper.loadAttribute(node, "Height", "0")));
   return rect;
 }