Skip to content

Commit 09701f7

Browse files
committed
Use ImageGcDrawer for bgimages in CTabFolder
This commit addresses rendering fragments that can occur when the background images of CTabFolder will be scaled with the monitor-specific scaling active in win32. Using the ImageGcDrawer to redraw the images on demand for the correct zoom removed the fragments.
1 parent df1c412 commit 09701f7

File tree

1 file changed

+1
-4
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom

1 file changed

+1
-4
lines changed

bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4007,10 +4007,7 @@ void updateBkImages(boolean colorChanged) {
40074007
if (colorChanged || !bounds.equals(bkImageBounds[i])) {
40084008
bkImageBounds[i] = bounds;
40094009
if (controlBkImages[i] != null) controlBkImages[i].dispose();
4010-
controlBkImages[i] = new Image(control.getDisplay(), bounds);
4011-
GC gc = new GC(controlBkImages[i]);
4012-
renderer.draw(CTabFolderRenderer.PART_BACKGROUND, 0, bounds, gc);
4013-
gc.dispose();
4010+
controlBkImages[i] = new Image(control.getDisplay(), (gc, imageWidth, imageHeight) -> renderer.draw(CTabFolderRenderer.PART_BACKGROUND, 0, bounds, gc), bounds.width, bounds.height);
40144011
control.setBackground(null);
40154012
control.setBackgroundImage(controlBkImages[i]);
40164013
}

0 commit comments

Comments
 (0)