Skip to content

Commit

Permalink
Fix misalignment of 1px when drawing an X
Browse files Browse the repository at this point in the history
  • Loading branch information
ievgen-baida committed Feb 29, 2024
1 parent 144e2b8 commit 59136f2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Eto/Forms/ThemedControls/ThemedDocumentControlHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -779,8 +779,12 @@ void DrawTab(Graphics g, ThemedDocumentPageHandler tab, int i)
var closeMargin = (int)tab.CloseRect.Height / 4;
var closeForegroundRect = RectangleF.Inset(tab.CloseRect, new PaddingF(closeMargin));
var closeForeground = Enabled ? closeSelected ? CloseHighlightForegroundColor : CloseForegroundColor : DisabledForegroundColor;

g.SaveTransform();
g.PixelOffsetMode = PixelOffsetMode.Half;
g.DrawLine(closeForeground, closeForegroundRect.TopLeft, closeForegroundRect.BottomRight);
g.DrawLine(closeForeground, closeForegroundRect.TopRight, closeForegroundRect.BottomLeft);
g.RestoreTransform();
}
}

Expand Down

0 comments on commit 59136f2

Please sign in to comment.