Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3534,7 +3534,7 @@ public void setLayoutData (Object layoutData) {
*/
public void setLocation (int x, int y) {
checkWidget ();
int zoom = getZoom();
int zoom = autoScaleDisabled ? parent.getZoom() : getZoom();
x = Win32DPIUtils.pointToPixel(x, zoom);
y = Win32DPIUtils.pointToPixel(y, zoom);
setLocationInPixels(x, y);
Expand Down Expand Up @@ -3791,7 +3791,7 @@ public void setRegion (Region region) {
*/
public void setSize (int width, int height) {
checkWidget ();
int zoom = getZoom();
int zoom = autoScaleDisabled ? parent.getZoom() : getZoom();
width = Win32DPIUtils.pointToPixel(width, zoom);
height = Win32DPIUtils.pointToPixel(height, zoom);
setSizeInPixels(width, height);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ public void setCursor(Cursor newCursor) {
checkWidget();
clientCursor = newCursor;
if (newCursor != null) {
if (inEvent) OS.SetCursor (Cursor.win32_getHandle(clientCursor, DPIUtil.getZoomForAutoscaleProperty(getNativeZoom())));
if (inEvent) OS.SetCursor (Cursor.win32_getHandle(clientCursor, getZoom()));
}
}

Expand Down Expand Up @@ -892,7 +892,7 @@ long transparentProc (long hwnd, long msg, long wParam, long lParam) {
break;
case OS.WM_SETCURSOR:
if (clientCursor != null) {
OS.SetCursor (Cursor.win32_getHandle(clientCursor, DPIUtil.getZoomForAutoscaleProperty(getNativeZoom())));
OS.SetCursor (Cursor.win32_getHandle(clientCursor, getZoom()));
return 1;
}
if (resizeCursor != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,7 @@ public void setData (String key, Object value) {

if (DATA_AUTOSCALE_DISABLED.equals(key)) {
autoScaleDisabled = Boolean.parseBoolean(value.toString());
this.nativeZoom = 100;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not take into account that autoScaleDisabled might be set to false. In that case, I would expect nativeZoom to be reset to shell zoom, i.e., nativeZoom = getData(DATA_SHELL_ZOOM). That's only available in Control but this functionality should be moved to Control anyway as it does not make sense for Widget, shouldn't it?

}
}

Expand Down Expand Up @@ -2711,9 +2712,6 @@ GC createNewGC(long hDC, GCData data) {
}

int getNativeZoom() {
if (autoScaleDisabled) {
return 100;
}
return nativeZoom;
}

Expand All @@ -2725,7 +2723,7 @@ int getZoom() {
}

void handleDPIChange(Event event, float scalingFactor) {
this.nativeZoom = event.detail;
this.nativeZoom = this.autoScaleDisabled ? 100 : event.detail;;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.nativeZoom = this.autoScaleDisabled ? 100 : event.detail;;
this.nativeZoom = this.autoScaleDisabled ? 100 : event.detail;

}

int getSystemMetrics(int nIndex) {
Expand Down
Loading