Skip to content

Commit 921c544

Browse files
HeikoKlareakoch-yatta
authored andcommitted
[Win32] Remove unused zoom parameter from CoordinateSystemMapper methods
The zoom parameter in some of the translation methods of the CoordinateSystemMappers and the according methods in Display is unused. This change simply removes the obsolete parameters.
1 parent 92eaae8 commit 921c544

File tree

9 files changed

+61
-63
lines changed

9 files changed

+61
-63
lines changed

bundles/org.eclipse.swt/Eclipse SWT Tests/win32/org/eclipse/swt/widgets/CoordinateSystemMapperTests.java

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -64,27 +64,27 @@ private SingleZoomCoordinateSystemMapper getSingleZoomCoordinateSystemMapper() {
6464
void translatePointInNoMonitorBackAndForthShouldBeTheSame(CoordinateSystemMapper mapper) {
6565
setupMonitors(mapper);
6666
Point pt = createExpectedPoint(mapper, 5000, -400, monitors[0]);
67-
Point px = mapper.translateToDisplayCoordinates(pt, monitors[0].getZoom());
68-
assertEquals(pt, mapper.translateFromDisplayCoordinates(px, monitors[0].getZoom()));
67+
Point px = mapper.translateToDisplayCoordinates(pt);
68+
assertEquals(pt, mapper.translateFromDisplayCoordinates(px));
6969
}
7070

7171
@Test
7272
void translatePointInGapBackAndForthInSingleZoomShouldBeTheSame() {
7373
SingleZoomCoordinateSystemMapper mapper = getSingleZoomCoordinateSystemMapper();
7474
setupMonitors(mapper);
7575
Point pt = new Point(1900, 400);
76-
Point px = mapper.translateToDisplayCoordinates(pt, monitors[0].getZoom());
77-
assertEquals(pt, mapper.translateFromDisplayCoordinates(px, monitors[0].getZoom()));
76+
Point px = mapper.translateToDisplayCoordinates(pt);
77+
assertEquals(pt, mapper.translateFromDisplayCoordinates(px));
7878
}
7979

8080
@Test
8181
void translatePointInGapBackAndForthInMultiZoomShouldEndInsideTheSameMonitor() {
8282
MultiZoomCoordinateSystemMapper mapper = getMultiZoomCoordinateSystemMapper();
8383
setupMonitors(mapper);
8484
Point pt = new Point(1900, 400);
85-
Point px = mapper.translateToDisplayCoordinates(pt, monitors[0].getZoom());
86-
Point translatedPt = mapper.translateFromDisplayCoordinates(px, monitors[0].getZoom());
87-
Point translatedPx = mapper.translateToDisplayCoordinates(translatedPt, monitors[0].getZoom());
85+
Point px = mapper.translateToDisplayCoordinates(pt);
86+
Point translatedPt = mapper.translateFromDisplayCoordinates(px);
87+
Point translatedPx = mapper.translateToDisplayCoordinates(translatedPt);
8888
assertEquals(new Point(translatedPt.x, translatedPt.y), translatedPx);
8989
assertEquals(translatedPx, px);
9090
}
@@ -94,26 +94,26 @@ void translatePointInGapBackAndForthInMultiZoomShouldEndInsideTheSameMonitor() {
9494
void translateRectangleInNoMonitorBackAndForthShouldBeTheSame(CoordinateSystemMapper mapper) {
9595
setupMonitors(mapper);
9696
Rectangle rectInPts = createExpectedRectangle(mapper, 5000, -400, 200, 200, monitors[0]);
97-
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts, monitors[0].getZoom());
98-
assertEquals(rectInPts, mapper.translateFromDisplayCoordinates(rectInPxs, monitors[0].getZoom()));
97+
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts);
98+
assertEquals(rectInPts, mapper.translateFromDisplayCoordinates(rectInPxs));
9999
}
100100

101101
@Test
102102
void translateRectangleInGapBackAndForthInSingleZoomShouldBeTheSame() {
103103
SingleZoomCoordinateSystemMapper mapper = getSingleZoomCoordinateSystemMapper();
104104
setupMonitors(mapper);
105105
Rectangle rectInPts = new Rectangle(1800, 400, 100, 100);
106-
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts, monitors[0].getZoom());
107-
assertEquals(rectInPts, mapper.translateFromDisplayCoordinates(rectInPxs, monitors[0].getZoom()));
106+
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts);
107+
assertEquals(rectInPts, mapper.translateFromDisplayCoordinates(rectInPxs));
108108
}
109109

110110
@Test
111111
void translateRectangleInGapBackAndForthInMultiZoomShouldBeInMonitorBounds() {
112112
MultiZoomCoordinateSystemMapper mapper = getMultiZoomCoordinateSystemMapper();
113113
setupMonitors(mapper);
114114
Rectangle rectInPts = new Rectangle(1800, 400, 100, 100);
115-
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts, monitors[0].getZoom());
116-
Rectangle rectInPtsTranslated = mapper.translateFromDisplayCoordinates(rectInPxs, monitors[0].getZoom());
115+
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts);
116+
Rectangle rectInPtsTranslated = mapper.translateFromDisplayCoordinates(rectInPxs);
117117
boolean isInsideMonitor = false;
118118
for (Monitor monitor : monitors) {
119119
if (monitor.getClientArea().intersects(rectInPtsTranslated)) {
@@ -129,46 +129,45 @@ void translateRectangleInGapPartiallyInRightBackAndForthInSingleZoomShouldBeTheS
129129
SingleZoomCoordinateSystemMapper mapper = getSingleZoomCoordinateSystemMapper();
130130
setupMonitors(mapper);
131131
Rectangle rectInPts = new Rectangle(1950, 400, 150, 100);
132-
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts, monitors[0].getZoom());
133-
assertEquals(rectInPts, mapper.translateFromDisplayCoordinates(rectInPxs, monitors[0].getZoom()));
132+
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts);
133+
assertEquals(rectInPts, mapper.translateFromDisplayCoordinates(rectInPxs));
134134
}
135135

136136
@Test
137137
void translateRectangleInGapPartiallyInRightBackAndForthInMultiZoomShouldBeInside() {
138138
MultiZoomCoordinateSystemMapper mapper = getMultiZoomCoordinateSystemMapper();
139139
setupMonitors(mapper);
140140
Rectangle rectInPts = new Rectangle.WithMonitor(1950, 400, 150, 100, monitors[1]);
141-
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts, monitors[0].getZoom());
142-
assertEquals(rectInPts, mapper.translateFromDisplayCoordinates(rectInPxs, monitors[0].getZoom()));
141+
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts);
142+
assertEquals(rectInPts, mapper.translateFromDisplayCoordinates(rectInPxs));
143143
}
144144

145145
@ParameterizedTest
146146
@MethodSource("provideCoordinateSystemMappers")
147147
void translateRectangleInGapPartiallyInLeftBackAndForthShouldBeTheSame(CoordinateSystemMapper mapper) {
148148
setupMonitors(mapper);
149149
Rectangle rectInPts = createExpectedRectangle(mapper, 750, 400, 100, 100, monitors[0]);
150-
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts, monitors[0].getZoom());
151-
assertEquals(rectInPts, mapper.translateFromDisplayCoordinates(rectInPxs, monitors[0].getZoom()));
150+
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts);
151+
assertEquals(rectInPts, mapper.translateFromDisplayCoordinates(rectInPxs));
152152
}
153153

154154
@Test
155155
void translateRectangleInPointsInBothMonitorsPartiallyBackAndForthInSingleZoomShouldBeTheSame() {
156156
SingleZoomCoordinateSystemMapper mapper = getSingleZoomCoordinateSystemMapper();
157157
setupMonitors(mapper);
158158
Rectangle rectInPts = new Rectangle(950, 400, 1500, 100);
159-
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts, monitors[0].getZoom());
160-
assertEquals(rectInPts, mapper.translateFromDisplayCoordinates(rectInPxs, monitors[0].getZoom()));
159+
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts);
160+
assertEquals(rectInPts, mapper.translateFromDisplayCoordinates(rectInPxs));
161161
}
162162

163163
@Test
164164
void translateRectangleInPointsInBothMonitorsPartiallyBackAndForthInMultiZoomShouldNotEndUpInGap() {
165165
MultiZoomCoordinateSystemMapper mapper = getMultiZoomCoordinateSystemMapper();
166166
setupMonitors(mapper);
167167
Rectangle rectInPts = new Rectangle(950, 400, 1500, 100);
168-
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts, monitors[0].getZoom());
169-
Rectangle rectInPtsTranslated = mapper.translateFromDisplayCoordinates(rectInPxs, monitors[0].getZoom());
170-
Rectangle rectInPxsTranslated = mapper.translateToDisplayCoordinates(rectInPtsTranslated,
171-
monitors[0].getZoom());
168+
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts);
169+
Rectangle rectInPtsTranslated = mapper.translateFromDisplayCoordinates(rectInPxs);
170+
Rectangle rectInPxsTranslated = mapper.translateToDisplayCoordinates(rectInPtsTranslated);
172171
assertEquals(rectInPxs, rectInPxsTranslated);
173172
}
174173

@@ -182,13 +181,13 @@ void moveRectangleInPixelsInRightMonitorsPartiallyBackAndForthShouldBeTheSame()
182181
expectedSmallRectInPxs.y = rectInPxs.y + (rectInPxs.height / 2) - 200;
183182
expectedSmallRectInPxs.width = 400;
184183
expectedSmallRectInPxs.height = 400;
185-
Rectangle rectInPts = mapper.translateFromDisplayCoordinates(rectInPxs, monitors[0].getZoom());
184+
Rectangle rectInPts = mapper.translateFromDisplayCoordinates(rectInPxs);
186185
Rectangle smallRectInPts = new Rectangle(0, 0, 0, monitors[0].getZoom());
187186
smallRectInPts.x = rectInPts.x + (rectInPts.width / 2) - 200;
188187
smallRectInPts.y = rectInPts.y + (rectInPts.height / 2) - 200;
189188
smallRectInPts.width = 400;
190189
smallRectInPts.height = 400;
191-
Rectangle smallRectInPxs = mapper.translateToDisplayCoordinates(smallRectInPts, monitors[0].getZoom());
190+
Rectangle smallRectInPxs = mapper.translateToDisplayCoordinates(smallRectInPts);
192191
assertEquals(expectedSmallRectInPxs, smallRectInPxs);
193192
}
194193

@@ -197,26 +196,26 @@ void moveRectangleInPixelsInRightMonitorsPartiallyBackAndForthShouldBeTheSame()
197196
void translateRectangleInPixelsOutisdeMonitorsBackAndForthShouldBeTheSame(CoordinateSystemMapper mapper) {
198197
setupMonitors(mapper);
199198
Rectangle rectInPxs = new Rectangle(400, 2400, 1000, 1000);
200-
Rectangle rectInPts = mapper.translateFromDisplayCoordinates(rectInPxs, monitors[0].getZoom());
201-
assertEquals(rectInPxs, mapper.translateToDisplayCoordinates(rectInPts, monitors[0].getZoom()));
199+
Rectangle rectInPts = mapper.translateFromDisplayCoordinates(rectInPxs);
200+
assertEquals(rectInPxs, mapper.translateToDisplayCoordinates(rectInPts));
202201
}
203202

204203
@ParameterizedTest
205204
@MethodSource("provideCoordinateSystemMappers")
206205
void translateRectangleInPixelsInBothMonitorsBackAndForthShouldBeTheSame(CoordinateSystemMapper mapper) {
207206
setupMonitors(mapper);
208207
Rectangle rectInPxs = new Rectangle(1500, 400, 502, 500);
209-
Rectangle rectInPts = mapper.translateFromDisplayCoordinates(rectInPxs, monitors[0].getZoom());
210-
assertEquals(rectInPxs, mapper.translateToDisplayCoordinates(rectInPts, monitors[0].getZoom()));
208+
Rectangle rectInPts = mapper.translateFromDisplayCoordinates(rectInPxs);
209+
assertEquals(rectInPxs, mapper.translateToDisplayCoordinates(rectInPts));
211210
}
212211

213212
@ParameterizedTest
214213
@MethodSource("provideCoordinateSystemMappers")
215214
void translateRectangleInPixelsForZeroSize(CoordinateSystemMapper mapper) {
216215
setupMonitors(mapper);
217216
Rectangle rectInPts = createExpectedRectangle(mapper, 0, 0, 0, 0, monitors[0]);
218-
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts, monitors[0].getZoom());
219-
assertEquals(rectInPts, mapper.translateFromDisplayCoordinates(rectInPxs, monitors[0].getZoom()));
217+
Rectangle rectInPxs = mapper.translateToDisplayCoordinates(rectInPts);
218+
assertEquals(rectInPts, mapper.translateFromDisplayCoordinates(rectInPxs));
220219
}
221220

222221
private Point createExpectedPoint(CoordinateSystemMapper mapper, int x, int y, Monitor monitor) {

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4028,10 +4028,9 @@ void subclass () {
40284028
*/
40294029
public Point toControl (int x, int y) {
40304030
checkWidget ();
4031-
int zoom = getZoom();
4032-
Point displayPointInPixels = getDisplay().translateToDisplayCoordinates(new Point(x, y), zoom);
4031+
Point displayPointInPixels = getDisplay().translateToDisplayCoordinates(new Point(x, y));
40334032
final Point controlPointInPixels = toControlInPixels(displayPointInPixels.x, displayPointInPixels.y);
4034-
return Win32DPIUtils.pixelToPoint(controlPointInPixels, zoom);
4033+
return Win32DPIUtils.pixelToPoint(controlPointInPixels, getZoom());
40354034
}
40364035

40374036
Point toControlInPixels (int x, int y) {
@@ -4091,7 +4090,7 @@ public Point toDisplay (int x, int y) {
40914090
checkWidget ();
40924091
int zoom = getZoom();
40934092
Point displayPointInPixels = toDisplayInPixels(Win32DPIUtils.pointToPixel(x, zoom), Win32DPIUtils.pointToPixel(y, zoom));
4094-
return getDisplay().translateFromDisplayCoordinates(displayPointInPixels, zoom);
4093+
return getDisplay().translateFromDisplayCoordinates(displayPointInPixels);
40954094
}
40964095

40974096
Point toDisplayInPixels (int x, int y) {

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/CoordinateSystemMapper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ interface CoordinateSystemMapper {
2727

2828
Rectangle mapMonitorBounds(Rectangle rectangle, int zoom);
2929

30-
Point translateFromDisplayCoordinates(Point point, int zoom);
30+
Point translateFromDisplayCoordinates(Point point);
3131

32-
Point translateToDisplayCoordinates(Point point, int zoom);
32+
Point translateToDisplayCoordinates(Point point);
3333

34-
Rectangle translateFromDisplayCoordinates(Rectangle rect, int zoom);
34+
Rectangle translateFromDisplayCoordinates(Rectangle rect);
3535

36-
Rectangle translateToDisplayCoordinates(Rectangle rect, int zoom);
36+
Rectangle translateToDisplayCoordinates(Rectangle rect);
3737

3838
Rectangle getContainingMonitorBoundsInPixels(Point point);
3939

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3166,20 +3166,20 @@ Rectangle mapInPixels (Control from, Control to, int x, int y, int width, int he
31663166
return new Rectangle (rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);
31673167
}
31683168

3169-
Point translateFromDisplayCoordinates(Point point, int zoom) {
3170-
return coordinateSystemMapper.translateFromDisplayCoordinates(point, zoom);
3169+
Point translateFromDisplayCoordinates(Point point) {
3170+
return coordinateSystemMapper.translateFromDisplayCoordinates(point);
31713171
}
31723172

3173-
Point translateToDisplayCoordinates(Point point, int zoom) {
3174-
return coordinateSystemMapper.translateToDisplayCoordinates(point, zoom);
3173+
Point translateToDisplayCoordinates(Point point) {
3174+
return coordinateSystemMapper.translateToDisplayCoordinates(point);
31753175
}
31763176

3177-
Rectangle translateFromDisplayCoordinates(Rectangle rect, int zoom) {
3178-
return coordinateSystemMapper.translateFromDisplayCoordinates(rect, zoom);
3177+
Rectangle translateFromDisplayCoordinates(Rectangle rect) {
3178+
return coordinateSystemMapper.translateFromDisplayCoordinates(rect);
31793179
}
31803180

3181-
Rectangle translateToDisplayCoordinates(Rectangle rect, int zoom) {
3182-
return coordinateSystemMapper.translateToDisplayCoordinates(rect, zoom);
3181+
Rectangle translateToDisplayCoordinates(Rectangle rect) {
3182+
return coordinateSystemMapper.translateToDisplayCoordinates(rect);
31833183
}
31843184

31853185
long messageProc (long hwnd, long msg, long wParam, long lParam) {

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Menu.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,7 @@ void setLocationInPixels (int x, int y) {
12251225
public void setLocation (Point location) {
12261226
checkWidget ();
12271227
if (location == null) error (SWT.ERROR_NULL_ARGUMENT);
1228-
Point locationInPixels = getDisplay().translateToDisplayCoordinates(location, getZoom());
1228+
Point locationInPixels = getDisplay().translateToDisplayCoordinates(location);
12291229
setLocationInPixels(locationInPixels.x, locationInPixels.y);
12301230
}
12311231

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/MultiZoomCoordinateSystemMapper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,24 +92,24 @@ public Rectangle mapMonitorBounds(Rectangle rect, int zoom) {
9292
}
9393

9494
@Override
95-
public Point translateFromDisplayCoordinates(Point point, int zoom) {
95+
public Point translateFromDisplayCoordinates(Point point) {
9696
return translateLocationInPixelsToPoints(point.x, point.y);
9797
}
9898

9999
@Override
100-
public Point translateToDisplayCoordinates(Point point, int zoom) {
100+
public Point translateToDisplayCoordinates(Point point) {
101101
Monitor monitor = point instanceof Point.WithMonitor pointWithMonitor ? pointWithMonitor.getMonitor() : null;
102102
return translateLocationInPointsToPixels(point.x, point.y, monitor);
103103
}
104104

105105
@Override
106-
public Rectangle translateFromDisplayCoordinates(Rectangle rect, int zoom) {
106+
public Rectangle translateFromDisplayCoordinates(Rectangle rect) {
107107
Monitor monitor = rect instanceof Rectangle.WithMonitor rectWithMonitor ? rectWithMonitor.getMonitor() : null;
108108
return translateRectangleInPixelsToPoints(rect.x, rect.y, rect.width, rect.height, monitor);
109109
}
110110

111111
@Override
112-
public Rectangle translateToDisplayCoordinates(Rectangle rect, int zoom) {
112+
public Rectangle translateToDisplayCoordinates(Rectangle rect) {
113113
Monitor monitor = rect instanceof Rectangle.WithMonitor rectWithMonitor ? rectWithMonitor.getMonitor() : null;
114114
return translateRectangleInPointsToPixels(rect.x, rect.y, rect.width, rect.height, monitor);
115115
}

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Shell.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,20 +1561,20 @@ public void setAlpha (int alpha) {
15611561
@Override
15621562
public Rectangle getBounds() {
15631563
checkWidget ();
1564-
return getDisplay().translateFromDisplayCoordinates(getBoundsInPixels(), getZoom());
1564+
return getDisplay().translateFromDisplayCoordinates(getBoundsInPixels());
15651565
}
15661566

15671567
@Override
15681568
public Point getLocation() {
15691569
checkWidget ();
1570-
return getDisplay().translateFromDisplayCoordinates(getLocationInPixels(), getZoom());
1570+
return getDisplay().translateFromDisplayCoordinates(getLocationInPixels());
15711571
}
15721572

15731573
@Override
15741574
public void setLocation(Point location) {
15751575
if (location == null) error (SWT.ERROR_NULL_ARGUMENT);
15761576
checkWidget ();
1577-
Point locationInPixels = getDisplay().translateToDisplayCoordinates(location, getZoom());
1577+
Point locationInPixels = getDisplay().translateToDisplayCoordinates(location);
15781578
setLocationInPixels(locationInPixels.x, locationInPixels.y);
15791579
}
15801580

@@ -1587,7 +1587,7 @@ public void setLocation(int x, int y) {
15871587
public void setBounds(Rectangle rect) {
15881588
if (rect == null) error (SWT.ERROR_NULL_ARGUMENT);
15891589
checkWidget ();
1590-
Rectangle boundsInPixels = getDisplay().translateToDisplayCoordinates(rect, getZoom());
1590+
Rectangle boundsInPixels = getDisplay().translateToDisplayCoordinates(rect);
15911591
// The scaling of the width and height in case of a monitor change is handled by
15921592
// the WM_DPICHANGED event processing. So to avoid duplicate scaling, we always
15931593
// have to scale width and height with the zoom of the original monitor (still

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/SingleZoomCoordinateSystemMapper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,22 @@ public Rectangle mapMonitorBounds(Rectangle rect, int zoom) {
7676
}
7777

7878
@Override
79-
public Point translateFromDisplayCoordinates(Point point, int zoom) {
79+
public Point translateFromDisplayCoordinates(Point point) {
8080
return Win32DPIUtils.pixelToPoint(point, DPIUtil.getDeviceZoom());
8181
}
8282

8383
@Override
84-
public Point translateToDisplayCoordinates(Point point, int zoom) {
84+
public Point translateToDisplayCoordinates(Point point) {
8585
return Win32DPIUtils.pointToPixel(point, DPIUtil.getDeviceZoom());
8686
}
8787

8888
@Override
89-
public Rectangle translateFromDisplayCoordinates(Rectangle rect, int zoom) {
89+
public Rectangle translateFromDisplayCoordinates(Rectangle rect) {
9090
return Win32DPIUtils.pixelToPoint(rect, DPIUtil.getDeviceZoom());
9191
}
9292

9393
@Override
94-
public Rectangle translateToDisplayCoordinates(Rectangle rect, int zoom) {
94+
public Rectangle translateToDisplayCoordinates(Rectangle rect) {
9595
return Win32DPIUtils.pointToPixel(rect, DPIUtil.getDeviceZoom());
9696
}
9797

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Widget.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1696,7 +1696,7 @@ boolean showMenu (int x, int y) {
16961696

16971697
boolean showMenu (int x, int y, int detail) {
16981698
Event event = new Event ();
1699-
Point mappedLocation = getDisplay().translateFromDisplayCoordinates(new Point(x, y), getZoom());
1699+
Point mappedLocation = getDisplay().translateFromDisplayCoordinates(new Point(x, y));
17001700
event.setLocation(mappedLocation.x, mappedLocation.y);
17011701
event.detail = detail;
17021702
if (event.detail == SWT.MENU_KEYBOARD) {

0 commit comments

Comments
 (0)