diff options
author | Sven Gothel <[email protected]> | 2020-01-12 04:12:29 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-01-12 04:12:29 +0100 |
commit | e3e671e3ca63235830a2ebf7875650a4c86ce18e (patch) | |
tree | a05841e019b78b1066aa69a8ae1262cf86e09b82 /src | |
parent | f6a5ae588440ff873fd72f3b52956e7b02d4e728 (diff) |
NativeWindow Point.set*(..): Return instance for scaling (chaining)
Diffstat (limited to 'src')
-rw-r--r-- | src/nativewindow/classes/com/jogamp/nativewindow/util/Point.java | 22 | ||||
-rw-r--r-- | src/newt/classes/jogamp/newt/OffscreenWindow.java | 3 |
2 files changed, 20 insertions, 5 deletions
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/util/Point.java b/src/nativewindow/classes/com/jogamp/nativewindow/util/Point.java index aa511b625..7f5f65b9f 100644 --- a/src/nativewindow/classes/com/jogamp/nativewindow/util/Point.java +++ b/src/nativewindow/classes/com/jogamp/nativewindow/util/Point.java @@ -102,9 +102,25 @@ public class Point implements Cloneable, PointImmutable { return x + " / " + y; } - public final void set(final int x, final int y) { this.x = x; this.y = y; } - public final void setX(final int x) { this.x = x; } - public final void setY(final int y) { this.y = y; } + /** + * Set this instance's x- and y-component. + * @param x value for x-component + * @param y value for y-component + * @return this instance for scaling + */ + public final Point set(final int x, final int y) { this.x = x; this.y = y; return this; } + /** + * Set this instance's x--component. + * @param x value for x-component + * @return this instance for scaling + */ + public final Point setX(final int x) { this.x = x; return this; } + /** + * Set this instance's y-component. + * @param y value for y-component + * @return this instance for scaling + */ + public final Point setY(final int y) { this.y = y; return this; } /** * Translate this instance's x- and y-components, diff --git a/src/newt/classes/jogamp/newt/OffscreenWindow.java b/src/newt/classes/jogamp/newt/OffscreenWindow.java index be07cda0a..299bb1f73 100644 --- a/src/newt/classes/jogamp/newt/OffscreenWindow.java +++ b/src/newt/classes/jogamp/newt/OffscreenWindow.java @@ -140,8 +140,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface { @Override public Point getLocationOnScreen(final Point storage) { if(null!=storage) { - storage.set(0, 0); - return storage; + return storage.set(0, 0); } return new Point(0,0); } |