Skip to content

Commit 16e501f

Browse files
vogellaclaude
authored andcommitted
Remove fillRegion() and Region.subtract block in CTabFolderRenderer
With square tab corners, the Region.subtract block in drawTabArea that painted parent background into curved-corner cutouts was always empty. Remove it along with the now-unused fillRegion() helper. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3dfe610 commit 16e501f

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

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

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,13 +1200,6 @@ void drawTabArea(GC gc, Rectangle bounds, int state) {
12001200
boolean single = parent.single;
12011201
boolean bkSelected = single && selectedIndex != -1;
12021202
drawBackground(gc, shape, bkSelected);
1203-
// Fill in parent background for non-rectangular shape
1204-
Region r = new Region();
1205-
r.add(new Rectangle(x, y, width + 1, height + 1));
1206-
r.subtract(shape);
1207-
gc.setBackground(parent.getParent().getBackground());
1208-
fillRegion(gc, r);
1209-
r.dispose();
12101203

12111204
// Draw selected tab
12121205
if (selectedIndex == -1) {
@@ -1293,16 +1286,7 @@ void drawUnselected(int index, GC gc, Rectangle bounds, int state) {
12931286
}
12941287
}
12951288

1296-
void fillRegion(GC gc, Region region) {
1297-
// NOTE: region passed in to this function will be modified
1298-
Region clipping = new Region();
1299-
gc.getClipping(clipping);
1300-
region.intersect(clipping);
1301-
gc.setClipping(region);
1302-
gc.fillRectangle(region.getBounds());
1303-
gc.setClipping(clipping);
1304-
clipping.dispose();
1305-
}
1289+
13061290

13071291
Color getFillColor() {
13081292
if (fillColor == null) {

0 commit comments

Comments
 (0)