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 @@ -5833,15 +5833,12 @@ Point textExtentInPixels(String string, int flags) {
return new Point(rect.right, rect.bottom);
}

void refreshFor(Drawable drawable, int zoom) {
void refreshFor(Drawable drawable) {
if (drawable == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
if (zoom == getZoom()) {
return;
}
destroy();
GCData newData = new GCData();
originalData.copyTo(newData);
createGcHandle(drawable, newData, zoom);
createGcHandle(drawable, newData);
}

/**
Expand Down Expand Up @@ -5947,8 +5944,7 @@ private void storeAndApplyOperationForExistingHandle(Operation operation) {
operation.apply();
}

private void createGcHandle(Drawable drawable, GCData newData, int nativeZoom) {
newData.nativeZoom = nativeZoom;
private void createGcHandle(Drawable drawable, GCData newData) {
long newHandle = drawable.internal_new_GC(newData);
if (newHandle == 0) SWT.error(SWT.ERROR_NO_HANDLES);
init(drawable, newData, newHandle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2177,10 +2177,12 @@ protected ImageHandle newImageHandle(int zoom) {
return createBaseHandle(zoom);
}
if (memGC != null) {
GC currentGC = memGC;
memGC = null;
createHandle(zoom);
currentGC.refreshFor(new DrawableWrapper(Image.this, zoom), zoom);
if (memGC.getZoom() != zoom) {
GC currentGC = memGC;
memGC = null;
createHandle(zoom);
currentGC.refreshFor(new DrawableWrapper(Image.this, zoom));
}
return zoomLevelToImageHandle.get(zoom);
}
return super.newImageHandle(zoom);
Expand Down
Loading