ctucx.git: trainsearch

web based trip-planner, fork of https://cyberchaos.dev/yuka/trainsearch

commit 315d61f39f1f4dcfac088482504448c9ac09f1a5
parent 5605a1f82dd016bee08de1ca224c24099a16b6e4
Author: Yureka <yuka@yuka.dev>
Date: Sat, 10 Sep 2022 18:33:46 +0200

canvas improved cancel for tram
1 file changed, 6 insertions(+), 2 deletions(-)
M
src/canvas.js
|
8
++++++--
diff --git a/src/canvas.js b/src/canvas.js
@@ -38,6 +38,10 @@ const colors = {
 		'national': '#ee3333',
 		default: '#fff'
 	},
+	cancelFill: {
+		'tram': '#fff',
+		default: '#cc4444ff',
+	},
 	icon: {
 		'walk': 'directions_walk',
 		'transfer': 'directions_transfer',

@@ -309,11 +313,11 @@ const renderJourneys = () => {
 			}
 
 			if (leg.cancelled) {
-				ctx.strokeStyle = '#cc4444ff';
-				ctx.lineWidth = 5;
 				ctx.beginPath();
 				ctx.moveTo(x, y);
 				ctx.lineTo(x + rectWidth, y + duration);
+				ctx.strokeStyle = colorFor(leg, 'cancelFill');
+				ctx.lineWidth = 5;
 				ctx.stroke();
 				ctx.lineWidth = 1;
 			}