- } else if (constraints.y == 0) {// force width
- return new Point(constraints.x, scale(orig.y, orig.x, constraints.x));
- } else if (constraints.x == 0) {// force height
- return new Point(scale(orig.x, orig.y, constraints.y), constraints.y);
+ } else if (constraints.getHeight() == 0) {// force width
+ return new Cms2DSize(constraints.getWidth(),
+ scale(orig.getHeight(), orig.getWidth(), constraints.getWidth()));
+ } else if (constraints.getWidth() == 0) {// force height
+ return new Cms2DSize(scale(orig.getWidth(), orig.getHeight(), constraints.getHeight()),
+ constraints.getHeight());