Skip to content

Commit 5e92c7d

Browse files
Fix OnBottom case
1 parent 821d87a commit 5e92c7d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt

bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/CTabRendering.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -631,10 +631,10 @@ void drawSelectedTab(int itemIndex, GC gc, Rectangle bounds) {
631631
highlightOnTop = !highlightOnTop;
632632
}
633633

634-
if (highlightOnTop && cornerSize != SQUARE_CORNER) {
634+
if (highlightOnTop != onBottom && cornerSize != SQUARE_CORNER) {
635635
// When using round tabs, extract the part of the outline that covers the
636636
// highlight and draw it with adapted height
637-
int[] highlightShape = Arrays.copyOfRange(tabOutlinePoints, 12, tabOutlinePoints.length - 12);
637+
int[] highlightShape = Arrays.copyOfRange(tabOutlinePoints, 14, tabOutlinePoints.length - 14);
638638
int yEnd = !highlightOnTop
639639
? outlineBoundsForOutline.y + outlineBoundsForOutline.height - highlightHeight + 1
640640
: highlightHeight;
@@ -647,9 +647,9 @@ void drawSelectedTab(int itemIndex, GC gc, Rectangle bounds) {
647647
// When using square tab or drawing the highlight at the bottom, simply draw a
648648
// line
649649
int highlightY = highlightOnTop ? outlineBoundsForOutline.y
650-
: bounds.y + bounds.height - highlightHeight + 1;
650+
: bounds.y + bounds.height - highlightHeight + (!onBottom ? 1 : 0);
651651
gc.fillRectangle(outlineBoundsForOutline.x, highlightY, outlineBoundsForOutline.width, highlightHeight);
652-
if (highlightOnTop) {
652+
if (highlightOnTop && !onBottom) {
653653
// Compensate for the outline being draw on top of the filled region by
654654
// extending the highlight with an equally wide line next to the filled region
655655
gc.setLineWidth(1);

0 commit comments

Comments
 (0)