Skip to content

Commit

Permalink
Use ImageGcDrawer for bgimages in CTabFolder
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
akoch-yatta authored and HeikoKlare committed Feb 11, 2025
1 parent 3d3406d commit 3e8da4a
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4007,10 +4007,7 @@ void updateBkImages(boolean colorChanged) {
if (colorChanged || !bounds.equals(bkImageBounds[i])) {
bkImageBounds[i] = bounds;
if (controlBkImages[i] != null) controlBkImages[i].dispose();
controlBkImages[i] = new Image(control.getDisplay(), bounds);
GC gc = new GC(controlBkImages[i]);
renderer.draw(CTabFolderRenderer.PART_BACKGROUND, 0, bounds, gc);
gc.dispose();
controlBkImages[i] = new Image(control.getDisplay(), (gc, imageWidth, imageHeight) -> renderer.draw(CTabFolderRenderer.PART_BACKGROUND, 0, bounds, gc), bounds.width, bounds.height);
control.setBackground(null);
control.setBackgroundImage(controlBkImages[i]);
}
Expand Down

0 comments on commit 3e8da4a

Please sign in to comment.