From 404117d1705aa3f03a367857a94723475b5a4343 Mon Sep 17 00:00:00 2001 From: Dennis Orlando Date: Sat, 2 Aug 2025 00:37:20 +0200 Subject: [PATCH] fix styling for indicator --- src/c3nav/editor/static/editor/css/editor.scss | 2 +- src/c3nav/editor/static/editor/js/editor.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/c3nav/editor/static/editor/css/editor.scss b/src/c3nav/editor/static/editor/css/editor.scss index 09031037..b782dc1c 100644 --- a/src/c3nav/editor/static/editor/css/editor.scss +++ b/src/c3nav/editor/static/editor/css/editor.scss @@ -601,7 +601,7 @@ label.theme-color-label { /* Snap indicator styles */ .snap-indicator { - transform: scale(13.6); + transform: scale(11.6); transform-box: fill-box; transform-origin: center; z-index: 1000; diff --git a/src/c3nav/editor/static/editor/js/editor.js b/src/c3nav/editor/static/editor/js/editor.js index 9775fa38..cd69262e 100644 --- a/src/c3nav/editor/static/editor/js/editor.js +++ b/src/c3nav/editor/static/editor/js/editor.js @@ -1753,7 +1753,7 @@ editor = { candidates.push(snapPoint); } }); - + // Find the closest candidate if (candidates.length > 0) { candidates.sort(function(a, b) { return a.distance - b.distance; }); @@ -1800,9 +1800,10 @@ editor = { // Check each edge of the geometry for (var i = 0; i < coordinates.length; i++) { + var p1 = coordinates[i]; var p2 = coordinates[(i + 1) % coordinates.length]; - + var snapPoint = editor._find_closest_point_on_edge(p1, p2, targetLatLng, targetMapPoint); if (snapPoint && snapPoint.distance < closestDistance) { closestDistance = snapPoint.distance; @@ -1871,11 +1872,10 @@ editor = { ]; var indicator = L.rectangle(bounds, { - color: '#ff6b6b', + color: '#666', weight: 2, lineCap: "square", - fillColor: '#ff6b6b', - fillOpacity: 0.8, + fillOpacity: 1., className: 'snap-indicator' });