Skip to content
Merged
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 @@ -200,11 +200,8 @@ public void scroll (int destX, int destY, int x, int y, int width, int height, b
int zoom = getZoom();
destX = DPIUtil.scaleUp(destX, zoom);
destY = DPIUtil.scaleUp(destY, zoom);
x = DPIUtil.scaleUp(x, zoom);
y = DPIUtil.scaleUp(y, zoom);
width = DPIUtil.scaleUp(width, zoom);
height = DPIUtil.scaleUp(height, zoom);
scrollInPixels(destX, destY, x, y, width, height, all);
Rectangle rectangle = DPIUtil.scaleUp(new Rectangle(x, y, width, height), zoom);
scrollInPixels(destX, destY, rectangle.x, rectangle.y, rectangle.width, rectangle.height, all);
}

void scrollInPixels (int destX, int destY, int x, int y, int width, int height, boolean all) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,10 @@ int applyThemeBackground () {
public void drawBackground (GC gc, int x, int y, int width, int height, int offsetX, int offsetY) {
checkWidget ();
int zoom = getZoom();
x = DPIUtil.scaleUp(x, zoom);
y = DPIUtil.scaleUp(y, zoom);
width = DPIUtil.scaleUp(width, zoom);
height = DPIUtil.scaleUp(height, zoom);
Rectangle rectangle = DPIUtil.scaleUp(new Rectangle(x, y, width, height), zoom);
offsetX = DPIUtil.scaleUp(offsetX, zoom);
offsetY = DPIUtil.scaleUp(offsetY, zoom);
drawBackgroundInPixels(gc, x, y, width, height, offsetX, offsetY);
drawBackgroundInPixels(gc, rectangle.x, rectangle.y, rectangle.width, rectangle.height, offsetX, offsetY);
}

void drawBackgroundInPixels(GC gc, int x, int y, int width, int height, int offsetX, int offsetY) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2434,14 +2434,11 @@ public void redraw () {
public void redraw (int x, int y, int width, int height, boolean all) {
checkWidget ();
int zoom = getZoom();
x = DPIUtil.scaleUp(x, zoom);
y = DPIUtil.scaleUp(y, zoom);
width = DPIUtil.scaleUp(width, zoom);
height = DPIUtil.scaleUp(height, zoom);
if (width <= 0 || height <= 0) return;
Rectangle rectangle = DPIUtil.scaleUp(new Rectangle(x, y, width, height), zoom);

RECT rect = new RECT ();
OS.SetRect (rect, x, y, x + width, y + height);
OS.SetRect (rect, rectangle.x, rectangle.y, rectangle.x + rectangle.width, rectangle.y + rectangle.height);

redrawInPixels(rect, all);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,8 @@ long callWindowProc (long hwnd, int msg, long wParam, long lParam) {
public Rectangle computeTrim (int x, int y, int width, int height) {
checkWidget ();
int zoom = getZoom();
x = DPIUtil.scaleUp(x, zoom);
y = DPIUtil.scaleUp(y, zoom);
width = DPIUtil.scaleUp(width, zoom);
height = DPIUtil.scaleUp(height, zoom);
return DPIUtil.scaleDown(computeTrimInPixels(x, y, width, height), zoom);
Rectangle rectangle = DPIUtil.scaleUp(new Rectangle(x, y, width, height), zoom);
return DPIUtil.scaleDown(computeTrimInPixels(rectangle.x, rectangle.y, rectangle.width, rectangle.height), zoom);
}

Rectangle computeTrimInPixels (int x, int y, int width, int height) {
Expand Down
Loading