diff options
Diffstat (limited to 'src/nativewindow/classes/javax/media')
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/ScalableSurface.java | 21 | ||||
-rw-r--r-- | src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java | 6 |
2 files changed, 24 insertions, 3 deletions
diff --git a/src/nativewindow/classes/javax/media/nativewindow/ScalableSurface.java b/src/nativewindow/classes/javax/media/nativewindow/ScalableSurface.java index de6ba51d7..ffd5c224c 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/ScalableSurface.java +++ b/src/nativewindow/classes/javax/media/nativewindow/ScalableSurface.java @@ -65,7 +65,7 @@ public interface ScalableSurface { * Returns the requested pixel scale of the associated {@link NativeSurface}. * * @param result int[2] storage for the result - * @return the passed storage containing the requested pixelSize for chaining + * @return the passed storage containing the requested pixelScale for chaining */ int[] getRequestedSurfaceScale(final int[] result); @@ -73,8 +73,25 @@ public interface ScalableSurface { * Returns the current pixel scale of the associated {@link NativeSurface}. * * @param result int[2] storage for the result - * @return the passed storage containing the current pixelSize for chaining + * @return the passed storage containing the current pixelScale for chaining */ public int[] getCurrentSurfaceScale(final int[] result); + + /** + * Returns the native pixel scale of the associated {@link NativeSurface} + * reflecting it's currently bound <i>monitor surface resolution in pixels</i>. + * <p> + * The native pixel scale maybe used to determine the proper <i>dpi</i> + * value of this {@link NativeSurface}: + * <pre> + * surfacePpMM = monitorPpMM * currentSurfaceScale / nativeSurfaceScale, + * with PpMM == pixel per millimeter + * </pre> + * </p> + * + * @param result int[2] storage for the result + * @return the passed storage containing the native pixelScale for chaining + */ + public int[] getNativeSurfaceScale(final int[] result); } diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java index 24ccc836a..5c9dc279d 100644 --- a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java +++ b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java @@ -37,7 +37,11 @@ public class Dimension implements Cloneable, DimensionImmutable { this(0, 0); } - public Dimension(int width, int height) { + public Dimension(final int[] size) { + this(size[0], size[1]); + } + + public Dimension(final int width, final int height) { if(width<0 || height<0) { throw new IllegalArgumentException("width and height must be within: ["+0+".."+Integer.MAX_VALUE+"]"); } |