@@ -832,9 +832,7 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
832
832
checkWidget ();
833
833
if (wHint != SWT .DEFAULT && wHint < 0 ) wHint = 0 ;
834
834
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 );
838
836
}
839
837
840
838
Point computeSizeInPixels (int wHint , int hHint , boolean changed ) {
@@ -933,7 +931,7 @@ Accessible _getAccessible () {
933
931
*/
934
932
public Rectangle getBounds () {
935
933
checkWidget ();
936
- return DPIUtil . autoScaleDown ( getBoundsInPixels () );
934
+ return getBoundsInPixels ();
937
935
}
938
936
939
937
Rectangle getBoundsInPixels () {
@@ -975,7 +973,6 @@ Rectangle getBoundsInPixels () {
975
973
public void setBounds (Rectangle rect ) {
976
974
checkWidget ();
977
975
if (rect == null ) error (SWT .ERROR_NULL_ARGUMENT );
978
- rect = DPIUtil .autoScaleUp (rect );
979
976
setBounds (rect .x , rect .y , Math .max (0 , rect .width ), Math .max (0 , rect .height ), true , true );
980
977
}
981
978
@@ -1015,7 +1012,7 @@ void setBoundsInPixels (Rectangle rect) {
1015
1012
*/
1016
1013
public void setBounds (int x , int y , int width , int height ) {
1017
1014
checkWidget ();
1018
- Rectangle rect = DPIUtil . autoScaleUp ( new Rectangle (x , y , width , height ) );
1015
+ Rectangle rect = new Rectangle (x , y , width , height );
1019
1016
setBounds (rect .x , rect .y , Math .max (0 , rect .width ), Math .max (0 , rect .height ), true , true );
1020
1017
}
1021
1018
@@ -1234,7 +1231,7 @@ int setBounds (int x, int y, int width, int height, boolean move, boolean resize
1234
1231
*/
1235
1232
public Point getLocation () {
1236
1233
checkWidget ();
1237
- return DPIUtil . autoScaleDown ( getLocationInPixels () );
1234
+ return getLocationInPixels ();
1238
1235
}
1239
1236
1240
1237
Point getLocationInPixels () {
@@ -1271,7 +1268,6 @@ Point getLocationInPixels () {
1271
1268
public void setLocation (Point location ) {
1272
1269
checkWidget ();
1273
1270
if (location == null ) error (SWT .ERROR_NULL_ARGUMENT );
1274
- location = DPIUtil .autoScaleUp (location );
1275
1271
setBounds (location .x , location .y , 0 , 0 , true , false );
1276
1272
}
1277
1273
@@ -1301,7 +1297,7 @@ void setLocationInPixels (Point location) {
1301
1297
*/
1302
1298
public void setLocation (int x , int y ) {
1303
1299
checkWidget ();
1304
- Point loc = DPIUtil . autoScaleUp ( new Point (x , y ) );
1300
+ Point loc = new Point (x , y );
1305
1301
setBounds (loc .x , loc .y , 0 , 0 , true , false );
1306
1302
}
1307
1303
@@ -1325,7 +1321,7 @@ void setLocationInPixels(int x, int y) {
1325
1321
*/
1326
1322
public Point getSize () {
1327
1323
checkWidget ();
1328
- return DPIUtil . autoScaleDown ( getSizeInPixels () );
1324
+ return getSizeInPixels ();
1329
1325
}
1330
1326
1331
1327
Point getSizeInPixels () {
@@ -1364,7 +1360,6 @@ Point getSizeInPixels () {
1364
1360
public void setSize (Point size ) {
1365
1361
checkWidget ();
1366
1362
if (size == null ) error (SWT .ERROR_NULL_ARGUMENT );
1367
- size = DPIUtil .autoScaleUp (size );
1368
1363
setBounds (0 , 0 , Math .max (0 , size .x ), Math .max (0 , size .y ), false , true );
1369
1364
}
1370
1365
@@ -1483,7 +1478,7 @@ void setRelations () {
1483
1478
*/
1484
1479
public void setSize (int width , int height ) {
1485
1480
checkWidget ();
1486
- Point size = DPIUtil . autoScaleUp ( new Point (width , height ) );
1481
+ Point size = new Point (width , height );
1487
1482
setBounds (0 , 0 , Math .max (0 , size .x ), Math .max (0 , size .y ), false , true );
1488
1483
}
1489
1484
@@ -1667,9 +1662,9 @@ public Point toControl(int x, int y) {
1667
1662
GDK .gdk_window_get_origin (window , origin_x , origin_y );
1668
1663
}
1669
1664
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 ;
1673
1668
1674
1669
return new Point (x , y );
1675
1670
}
@@ -1732,9 +1727,9 @@ public Point toDisplay(int x, int y) {
1732
1727
GDK .gdk_window_get_origin (window , origin_x , origin_y );
1733
1728
}
1734
1729
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 ];
1738
1733
1739
1734
return new Point (x , y );
1740
1735
}
@@ -3018,7 +3013,7 @@ GdkRGBA getBaseGdkRGBA () {
3018
3013
* </ul>
3019
3014
*/
3020
3015
public int getBorderWidth () {
3021
- return DPIUtil . autoScaleDown ( getBorderWidthInPixels () );
3016
+ return getBorderWidthInPixels ();
3022
3017
}
3023
3018
3024
3019
int getBorderWidthInPixels () {
@@ -3557,8 +3552,7 @@ long gtk_button_press_event (long widget, long event, boolean sendMouseDown) {
3557
3552
// See comment in #dragDetect()
3558
3553
if (OS .isX11 ()) {
3559
3554
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 );
3562
3556
if (isDisposed ()) return 1 ;
3563
3557
}
3564
3558
}
@@ -3885,8 +3879,8 @@ long gtk_draw (long widget, long cairo) {
3885
3879
if (!hooksPaint ()) return 0 ;
3886
3880
Event event = new Event ();
3887
3881
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 ;
3890
3884
event .setBounds (eventBounds );
3891
3885
GCData data = new GCData ();
3892
3886
/*
@@ -4175,7 +4169,7 @@ long gtk_motion_notify_event (long widget, long event) {
4175
4169
int eventType = GDK .gdk_event_get_event_type (event );
4176
4170
if (eventType == GDK .GDK_3BUTTON_PRESS ) return 0 ;
4177
4171
4178
- Point scaledEvent = DPIUtil . autoScaleDown ( new Point ((int )eventX [0 ], (int ) eventY [0 ]) );
4172
+ Point scaledEvent = new Point ((int )eventX [0 ], (int ) eventY [0 ]);
4179
4173
4180
4174
int [] eventButton = new int [1 ];
4181
4175
int [] eventState = new int [1 ];
@@ -4708,8 +4702,7 @@ void redraw (boolean all) {
4708
4702
*/
4709
4703
public void redraw (int x , int y , int width , int height , boolean all ) {
4710
4704
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 );
4713
4706
}
4714
4707
4715
4708
void 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
4894
4887
event .button = button ;
4895
4888
Rectangle eventRect = new Rectangle (x , y , 0 , 0 );
4896
4889
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 ;
4898
4891
if (isStateMask ) {
4899
4892
event .stateMask = stateMask ;
4900
4893
} else {
@@ -5062,7 +5055,7 @@ boolean sendMouseEvent (int type, int button, int count, int detail, boolean sen
5062
5055
if (is_hint ) {
5063
5056
// coordinates are already window-relative, see #gtk_motion_notify_event(..) and bug 94502
5064
5057
Rectangle eventRect = new Rectangle ((int )x , (int )y , 0 , 0 );
5065
- event .setBounds (DPIUtil . autoScaleDown ( eventRect ) );
5058
+ event .setBounds (eventRect );
5066
5059
} else {
5067
5060
int [] origin_x = new int [1 ], origin_y = new int [1 ];
5068
5061
Rectangle eventRect ;
@@ -5071,15 +5064,15 @@ boolean sendMouseEvent (int type, int button, int count, int detail, boolean sen
5071
5064
// GDK.gdk_surface_get_origin (surface, origin_x, origin_y);
5072
5065
// eventRect = new Rectangle ((int)x - origin_x [0], (int)y - origin_y [0], 0, 0);
5073
5066
eventRect = new Rectangle ((int )x , (int )y , 0 , 0 );
5074
- event .setBounds (DPIUtil . autoScaleDown ( eventRect ) );
5067
+ event .setBounds (eventRect );
5075
5068
} else {
5076
5069
long window = eventWindow ();
5077
5070
GDK .gdk_window_get_origin (window , origin_x , origin_y );
5078
5071
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 );
5080
5073
}
5081
5074
}
5082
- if ((style & SWT .MIRRORED ) != 0 ) event .x = DPIUtil . autoScaleDown ( getClientWidth () ) - event .x ;
5075
+ if ((style & SWT .MIRRORED ) != 0 ) event .x = getClientWidth () - event .x ;
5083
5076
setInputState (event , state );
5084
5077
5085
5078
/**
@@ -6309,7 +6302,7 @@ boolean showMenu (int x, int y) {
6309
6302
boolean showMenu (int x , int y , int detail ) {
6310
6303
Event event = new Event ();
6311
6304
Rectangle eventRect = new Rectangle (x , y , 0 , 0 );
6312
- event .setBounds (DPIUtil . autoScaleDown ( eventRect ) );
6305
+ event .setBounds (eventRect );
6313
6306
event .detail = detail ;
6314
6307
sendEvent (SWT .MenuDetect , event );
6315
6308
//widget could be disposed at this point
@@ -6332,7 +6325,7 @@ boolean showMenu (int x, int y, int detail) {
6332
6325
6333
6326
return true ;
6334
6327
} else {
6335
- Rectangle rect = DPIUtil . autoScaleUp ( event .getBounds () );
6328
+ Rectangle rect = event .getBounds ();
6336
6329
if (rect .x != x || rect .y != y ) {
6337
6330
menu .setLocationInPixels (rect .x , rect .y );
6338
6331
}
0 commit comments