@@ -832,9 +832,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
832832 checkWidget ();
833833 if (wHint != SWT .DEFAULT && wHint < 0 ) wHint = 0 ;
834834 if (hHint != SWT .DEFAULT && hHint < 0 ) hHint = 0 ;
835- wHint = DPIUtil .autoScaleUp (wHint );
836- hHint = DPIUtil .autoScaleUp (hHint );
837- return DPIUtil .autoScaleDown (computeSizeInPixels (wHint , hHint , changed ));
835+ return computeSizeInPixels (wHint , hHint , changed );
838836}
839837
840838Point computeSizeInPixels (int wHint , int hHint , boolean changed ) {
@@ -933,7 +931,7 @@ Accessible _getAccessible () {
933931 */
934932public Rectangle getBounds () {
935933 checkWidget ();
936- return DPIUtil . autoScaleDown ( getBoundsInPixels () );
934+ return getBoundsInPixels ();
937935}
938936
939937Rectangle getBoundsInPixels () {
@@ -975,7 +973,6 @@ Rectangle getBoundsInPixels () {
975973public void setBounds (Rectangle rect ) {
976974 checkWidget ();
977975 if (rect == null ) error (SWT .ERROR_NULL_ARGUMENT );
978- rect = DPIUtil .autoScaleUp (rect );
979976 setBounds (rect .x , rect .y , Math .max (0 , rect .width ), Math .max (0 , rect .height ), true , true );
980977}
981978
@@ -1015,7 +1012,7 @@ void setBoundsInPixels (Rectangle rect) {
10151012 */
10161013public void setBounds (int x , int y , int width , int height ) {
10171014 checkWidget ();
1018- Rectangle rect = DPIUtil . autoScaleUp ( new Rectangle (x , y , width , height ) );
1015+ Rectangle rect = new Rectangle (x , y , width , height );
10191016 setBounds (rect .x , rect .y , Math .max (0 , rect .width ), Math .max (0 , rect .height ), true , true );
10201017}
10211018
@@ -1234,7 +1231,7 @@ int setBounds (int x, int y, int width, int height, boolean move, boolean resize
12341231 */
12351232public Point getLocation () {
12361233 checkWidget ();
1237- return DPIUtil . autoScaleDown ( getLocationInPixels () );
1234+ return getLocationInPixels ();
12381235}
12391236
12401237Point getLocationInPixels () {
@@ -1271,7 +1268,6 @@ Point getLocationInPixels () {
12711268public void setLocation (Point location ) {
12721269 checkWidget ();
12731270 if (location == null ) error (SWT .ERROR_NULL_ARGUMENT );
1274- location = DPIUtil .autoScaleUp (location );
12751271 setBounds (location .x , location .y , 0 , 0 , true , false );
12761272}
12771273
@@ -1301,7 +1297,7 @@ void setLocationInPixels (Point location) {
13011297 */
13021298public void setLocation (int x , int y ) {
13031299 checkWidget ();
1304- Point loc = DPIUtil . autoScaleUp ( new Point (x , y ) );
1300+ Point loc = new Point (x , y );
13051301 setBounds (loc .x , loc .y , 0 , 0 , true , false );
13061302}
13071303
@@ -1325,7 +1321,7 @@ void setLocationInPixels(int x, int y) {
13251321 */
13261322public Point getSize () {
13271323 checkWidget ();
1328- return DPIUtil . autoScaleDown ( getSizeInPixels () );
1324+ return getSizeInPixels ();
13291325}
13301326
13311327Point getSizeInPixels () {
@@ -1364,7 +1360,6 @@ Point getSizeInPixels () {
13641360public void setSize (Point size ) {
13651361 checkWidget ();
13661362 if (size == null ) error (SWT .ERROR_NULL_ARGUMENT );
1367- size = DPIUtil .autoScaleUp (size );
13681363 setBounds (0 , 0 , Math .max (0 , size .x ), Math .max (0 , size .y ), false , true );
13691364}
13701365
@@ -1483,7 +1478,7 @@ void setRelations () {
14831478 */
14841479public void setSize (int width , int height ) {
14851480 checkWidget ();
1486- Point size = DPIUtil . autoScaleUp ( new Point (width , height ) );
1481+ Point size = new Point (width , height );
14871482 setBounds (0 , 0 , Math .max (0 , size .x ), Math .max (0 , size .y ), false , true );
14881483}
14891484
@@ -1667,9 +1662,9 @@ public Point toControl(int x, int y) {
16671662 GDK .gdk_window_get_origin (window , origin_x , origin_y );
16681663 }
16691664
1670- x -= DPIUtil . autoScaleDown ( origin_x [0 ]) ;
1671- y -= DPIUtil . autoScaleDown ( origin_y [0 ]) ;
1672- if ((style & SWT .MIRRORED ) != 0 ) x = DPIUtil . autoScaleDown ( getClientWidth () ) - x ;
1665+ x -= origin_x [0 ];
1666+ y -= origin_y [0 ];
1667+ if ((style & SWT .MIRRORED ) != 0 ) x = getClientWidth () - x ;
16731668
16741669 return new Point (x , y );
16751670}
@@ -1732,9 +1727,9 @@ public Point toDisplay(int x, int y) {
17321727 GDK .gdk_window_get_origin (window , origin_x , origin_y );
17331728 }
17341729
1735- if ((style & SWT .MIRRORED ) != 0 ) x = DPIUtil . autoScaleDown ( getClientWidth () ) - x ;
1736- x += DPIUtil . autoScaleDown ( origin_x [0 ]) ;
1737- y += DPIUtil . autoScaleDown ( origin_y [0 ]) ;
1730+ if ((style & SWT .MIRRORED ) != 0 ) x = getClientWidth () - x ;
1731+ x += origin_x [0 ];
1732+ y += origin_y [0 ];
17381733
17391734 return new Point (x , y );
17401735}
@@ -3018,7 +3013,7 @@ GdkRGBA getBaseGdkRGBA () {
30183013 * </ul>
30193014 */
30203015public int getBorderWidth () {
3021- return DPIUtil . autoScaleDown ( getBorderWidthInPixels () );
3016+ return getBorderWidthInPixels ();
30223017}
30233018
30243019int getBorderWidthInPixels () {
@@ -3557,8 +3552,7 @@ long gtk_button_press_event (long widget, long event, boolean sendMouseDown) {
35573552 // See comment in #dragDetect()
35583553 if (OS .isX11 ()) {
35593554 if (dragging ) {
3560- Point scaledEvent = DPIUtil .autoScaleDown (new Point ((int )eventX [0 ], (int ) eventY [0 ]));
3561- sendDragEvent (eventButton [0 ], eventState [0 ], scaledEvent .x , scaledEvent .y , false );
3555+ sendDragEvent (eventButton [0 ], eventState [0 ], (int )eventX [0 ], (int )eventY [0 ], false );
35623556 if (isDisposed ()) return 1 ;
35633557 }
35643558 }
@@ -3885,8 +3879,8 @@ long gtk_draw (long widget, long cairo) {
38853879 if (!hooksPaint ()) return 0 ;
38863880 Event event = new Event ();
38873881 event .count = 1 ;
3888- Rectangle eventBounds = DPIUtil . autoScaleDown ( new Rectangle (rect .x , rect .y , rect .width , rect .height ) );
3889- if ((style & SWT .MIRRORED ) != 0 ) eventBounds .x = DPIUtil . autoScaleDown ( getClientWidth () ) - eventBounds .width - eventBounds .x ;
3882+ Rectangle eventBounds = new Rectangle (rect .x , rect .y , rect .width , rect .height );
3883+ if ((style & SWT .MIRRORED ) != 0 ) eventBounds .x = getClientWidth () - eventBounds .width - eventBounds .x ;
38903884 event .setBounds (eventBounds );
38913885 GCData data = new GCData ();
38923886 /*
@@ -4175,7 +4169,7 @@ long gtk_motion_notify_event (long widget, long event) {
41754169 int eventType = GDK .gdk_event_get_event_type (event );
41764170 if (eventType == GDK .GDK_3BUTTON_PRESS ) return 0 ;
41774171
4178- Point scaledEvent = DPIUtil . autoScaleDown ( new Point ((int )eventX [0 ], (int ) eventY [0 ]) );
4172+ Point scaledEvent = new Point ((int )eventX [0 ], (int ) eventY [0 ]);
41794173
41804174 int [] eventButton = new int [1 ];
41814175 int [] eventState = new int [1 ];
@@ -4708,8 +4702,7 @@ void redraw (boolean all) {
47084702 */
47094703public void redraw (int x , int y , int width , int height , boolean all ) {
47104704 checkWidget ();
4711- Rectangle rect = DPIUtil .autoScaleUp (new Rectangle (x , y , width , height ));
4712- redrawInPixels (rect .x , rect .y , rect .width , rect .height , all );
4705+ redrawInPixels (x , y , width , height , all );
47134706}
47144707
47154708void redrawInPixels (int x , int y , int width , int height , boolean all ) {
@@ -4894,7 +4887,7 @@ boolean sendDragEvent (int button, int stateMask, int x, int y, boolean isStateM
48944887 event .button = button ;
48954888 Rectangle eventRect = new Rectangle (x , y , 0 , 0 );
48964889 event .setBounds (eventRect );
4897- if ((style & SWT .MIRRORED ) != 0 ) event .x = DPIUtil . autoScaleDown ( getClientWidth () ) - event .x ;
4890+ if ((style & SWT .MIRRORED ) != 0 ) event .x = getClientWidth () - event .x ;
48984891 if (isStateMask ) {
48994892 event .stateMask = stateMask ;
49004893 } else {
@@ -5062,7 +5055,7 @@ boolean sendMouseEvent (int type, int button, int count, int detail, boolean sen
50625055 if (is_hint ) {
50635056 // coordinates are already window-relative, see #gtk_motion_notify_event(..) and bug 94502
50645057 Rectangle eventRect = new Rectangle ((int )x , (int )y , 0 , 0 );
5065- event .setBounds (DPIUtil . autoScaleDown ( eventRect ) );
5058+ event .setBounds (eventRect );
50665059 } else {
50675060 int [] origin_x = new int [1 ], origin_y = new int [1 ];
50685061 Rectangle eventRect ;
@@ -5071,15 +5064,15 @@ boolean sendMouseEvent (int type, int button, int count, int detail, boolean sen
50715064// GDK.gdk_surface_get_origin (surface, origin_x, origin_y);
50725065// eventRect = new Rectangle ((int)x - origin_x [0], (int)y - origin_y [0], 0, 0);
50735066 eventRect = new Rectangle ((int )x , (int )y , 0 , 0 );
5074- event .setBounds (DPIUtil . autoScaleDown ( eventRect ) );
5067+ event .setBounds (eventRect );
50755068 } else {
50765069 long window = eventWindow ();
50775070 GDK .gdk_window_get_origin (window , origin_x , origin_y );
50785071 eventRect = new Rectangle ((int )x - origin_x [0 ], (int )y - origin_y [0 ], 0 , 0 );
5079- event .setBounds (DPIUtil . autoScaleDown ( eventRect ) );
5072+ event .setBounds (eventRect );
50805073 }
50815074 }
5082- if ((style & SWT .MIRRORED ) != 0 ) event .x = DPIUtil . autoScaleDown ( getClientWidth () ) - event .x ;
5075+ if ((style & SWT .MIRRORED ) != 0 ) event .x = getClientWidth () - event .x ;
50835076 setInputState (event , state );
50845077
50855078 /**
@@ -6309,7 +6302,7 @@ boolean showMenu (int x, int y) {
63096302boolean showMenu (int x , int y , int detail ) {
63106303 Event event = new Event ();
63116304 Rectangle eventRect = new Rectangle (x , y , 0 , 0 );
6312- event .setBounds (DPIUtil . autoScaleDown ( eventRect ) );
6305+ event .setBounds (eventRect );
63136306 event .detail = detail ;
63146307 sendEvent (SWT .MenuDetect , event );
63156308 //widget could be disposed at this point
@@ -6332,7 +6325,7 @@ boolean showMenu (int x, int y, int detail) {
63326325
63336326 return true ;
63346327 } else {
6335- Rectangle rect = DPIUtil . autoScaleUp ( event .getBounds () );
6328+ Rectangle rect = event .getBounds ();
63366329 if (rect .x != x || rect .y != y ) {
63376330 menu .setLocationInPixels (rect .x , rect .y );
63386331 }
0 commit comments