feat: add route's active style

This commit is contained in:
chndfang 2025-06-12 17:42:17 +08:00
parent 8d44b731dd
commit a647025287
3 changed files with 7 additions and 4 deletions

View File

@ -14,9 +14,10 @@
"strokeActive": "#FCC947"
},
"route": {
"strokeActive": "#FCC947",
"stroke-0": "#8C8C8C",
"stroke-1": "#49AA19",
"stroke-2": "#D89614",
"stroke-2": "#1982F3",
"stroke-10": "#E63A3A"
},
"area": {

View File

@ -14,9 +14,10 @@
"strokeActive": "#EBB214"
},
"route": {
"strokeActive": "#EBB214",
"stroke-0": "#8C8C8C",
"stroke-1": "#52C41A",
"stroke-2": "#FAAD14",
"stroke-2": "#1982F3",
"stroke-10": "#E63A3A"
},
"area": {

View File

@ -789,7 +789,7 @@ function anchorPoint(pen: MapPen): void {
function drawLine(ctx: CanvasRenderingContext2D, pen: MapPen): void {
const theme = sTheme.editor;
const { iconSize: s = 10 } = pen.calculative ?? {};
const { active, lineWidth: w = 2, iconSize: s = 10 } = pen.calculative ?? {};
const [p1, p2] = pen.calculative?.worldAnchors ?? [];
const { x: x1 = 0, y: y1 = 0 } = p1 ?? {};
const { x: x2 = 0, y: y2 = 0 } = p2 ?? {};
@ -799,7 +799,8 @@ function drawLine(ctx: CanvasRenderingContext2D, pen: MapPen): void {
ctx.save();
ctx.beginPath();
ctx.strokeStyle = get(theme, `route.stroke-${pass}`) ?? '';
ctx.strokeStyle = get(theme, active ? 'route.strokeActive' : `route.stroke-${pass}`) ?? '';
ctx.lineWidth = active ? 1.5 * w : w;
ctx.moveTo(x1, y1);
switch (type) {
case MapRouteType.线: