From b831ebadcaea1eea7370f7ec0bffc59eaba7a5ba Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 16 Oct 2013 14:28:27 +0200 Subject: Add efficient set(..all..) to Dimension, Insets, Point and Rectangle of NativeWindow's util types. --- src/newt/classes/com/jogamp/newt/MonitorDevice.java | 5 +---- src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'src/newt/classes/com/jogamp') diff --git a/src/newt/classes/com/jogamp/newt/MonitorDevice.java b/src/newt/classes/com/jogamp/newt/MonitorDevice.java index 8bc7f40e3..42ac34240 100644 --- a/src/newt/classes/com/jogamp/newt/MonitorDevice.java +++ b/src/newt/classes/com/jogamp/newt/MonitorDevice.java @@ -183,10 +183,7 @@ public abstract class MonitorDevice { y1 = Math.min(y1, vp.getY()); y2 = Math.max(y2, vp.getY() + vp.getHeight()); } - result.setX(x1); - result.setY(y1); - result.setWidth(x2 - x1); - result.setHeight(y2 - y1); + result.set(x1, y1, x2 - x1, y2 - y1); return result; } diff --git a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java index 2fa83e0e2..a2135273b 100644 --- a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java +++ b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java @@ -497,8 +497,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol { if( isOSX ) { final Point los = OSXUtil.GetLocationOnScreen(nativeWindowHandle, false, 0, 0); // top-level position -> client window position - los.setX(los.getX() + insets.getLeftWidth()); - los.setY(los.getY() + insets.getTopHeight()); + los.set(los.getX() + insets.getLeftWidth(), los.getY() + insets.getTopHeight()); if(null!=point) { return point.translate(los); } else { -- cgit v1.2.3