- root.setWidth(root.minwidth, Math.min(Platform.getScreenWidth(), root.maxwidth));
- root.setHeight(root.minheight, Math.min(Platform.getScreenHeight(), root.maxheight));
+ // FIXME: document this in the reference
+ if (!root.test(root.HSHRINK) && root.maxwidth == Integer.MAX_VALUE)
+ root.maxwidth = Platform.getScreenWidth() / 2;
+ if (!root.test(root.VSHRINK) && root.maxheight == Integer.MAX_VALUE)
+ root.maxheight = Platform.getScreenHeight() / 2;
+ root.setWidth(root.minwidth,
+ root.test(root.HSHRINK)
+ ? Math.max(root.minwidth, root.contentwidth)
+ : Math.min(Platform.getScreenWidth(), root.maxwidth));
+ root.setHeight(root.minheight,
+ root.test(root.VSHRINK)
+ ? Math.max(root.minheight, root.contentheight)
+ : Math.min(Platform.getScreenHeight(), root.maxheight));