Skip to content

Commit 823949a

Browse files
committed
ux: fix tab border blur (anti-aliased)
Signed-off-by: leo <longshuang@msn.cn>
1 parent ab51702 commit 823949a

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/Views/LauncherTabBar.axaml.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ public override void Render(DrawingContext context)
6969

7070
var selectedIdx = LauncherTabsList.SelectedIndex;
7171
var count = LauncherTabsList.ItemCount;
72-
var separatorPen = new Pen(this.FindResource("Brush.FG2") as IBrush, 0.5);
72+
var separatorPen = new Pen(this.FindResource("Brush.FG2") as IBrush);
7373
var separatorY = (height - 18) * 0.5 + 1;
7474

7575
if (!IsScrollerVisible && selectedIdx > 0)
7676
{
7777
var container = LauncherTabsList.ContainerFromIndex(0);
7878
if (container != null)
7979
{
80-
var x = container.Bounds.Left - startX + LauncherTabsScroller.Bounds.X;
80+
var x = container.Bounds.Left - startX + LauncherTabsScroller.Bounds.X - 0.5;
8181
context.DrawLine(separatorPen, new Point(x, separatorY), new Point(x, separatorY + 18));
8282
}
8383
}
@@ -98,7 +98,7 @@ public override void Render(DrawingContext context)
9898
if (IsScrollerVisible && i == count - 1)
9999
break;
100100

101-
var separatorX = containerEndX - startX + LauncherTabsScroller.Bounds.X;
101+
var separatorX = containerEndX - startX + LauncherTabsScroller.Bounds.X - 0.5;
102102
context.DrawLine(separatorPen, new Point(separatorX, separatorY), new Point(separatorX, separatorY + 18));
103103
}
104104

@@ -121,29 +121,29 @@ public override void Render(DrawingContext context)
121121
var drawLeftX = activeStartX - startX + LauncherTabsScroller.Bounds.X;
122122
if (drawLeftX < LauncherTabsScroller.Bounds.X)
123123
{
124-
ctx.BeginFigure(new Point(LauncherTabsScroller.Bounds.X, bottom), true);
125-
ctx.LineTo(new Point(LauncherTabsScroller.Bounds.X, 1));
124+
ctx.BeginFigure(new Point(LauncherTabsScroller.Bounds.X - 0.5, bottom), true);
125+
ctx.LineTo(new Point(LauncherTabsScroller.Bounds.X - 0.5, 0.5));
126126
}
127127
else
128128
{
129-
ctx.BeginFigure(new Point(drawLeftX - 5, bottom), true);
130-
ctx.ArcTo(new Point(drawLeftX, bottom - 5), cornerSize, angle, false, SweepDirection.CounterClockwise);
131-
ctx.LineTo(new Point(drawLeftX, 6));
132-
ctx.ArcTo(new Point(drawLeftX + 5, 1), cornerSize, angle, false, SweepDirection.Clockwise);
129+
ctx.BeginFigure(new Point(drawLeftX - 5.5, bottom), true);
130+
ctx.ArcTo(new Point(drawLeftX - 0.5, bottom - 5), cornerSize, angle, false, SweepDirection.CounterClockwise);
131+
ctx.LineTo(new Point(drawLeftX - 0.5, 5.5));
132+
ctx.ArcTo(new Point(drawLeftX + 4.5, 0.5), cornerSize, angle, false, SweepDirection.Clockwise);
133133
}
134134

135135
var drawRightX = activeEndX - startX + LauncherTabsScroller.Bounds.X;
136136
if (drawRightX <= LauncherTabsScroller.Bounds.Right)
137137
{
138-
ctx.LineTo(new Point(drawRightX - 5, 1));
139-
ctx.ArcTo(new Point(drawRightX, 6), cornerSize, angle, false, SweepDirection.Clockwise);
140-
ctx.LineTo(new Point(drawRightX, bottom - 5));
141-
ctx.ArcTo(new Point(drawRightX + 5, bottom), cornerSize, angle, false, SweepDirection.CounterClockwise);
138+
ctx.LineTo(new Point(drawRightX - 5.5, 0.5));
139+
ctx.ArcTo(new Point(drawRightX - 0.5, 5.5), cornerSize, angle, false, SweepDirection.Clockwise);
140+
ctx.LineTo(new Point(drawRightX - 0.5, bottom - 5));
141+
ctx.ArcTo(new Point(drawRightX + 4.5, bottom), cornerSize, angle, false, SweepDirection.CounterClockwise);
142142
}
143143
else
144144
{
145-
ctx.LineTo(new Point(LauncherTabsScroller.Bounds.Right, 1));
146-
ctx.LineTo(new Point(LauncherTabsScroller.Bounds.Right, bottom));
145+
ctx.LineTo(new Point(LauncherTabsScroller.Bounds.Right - 0.5, 0.5));
146+
ctx.LineTo(new Point(LauncherTabsScroller.Bounds.Right - 0.5, bottom));
147147
}
148148
}
149149

0 commit comments

Comments
 (0)