From 354949527beaa0396f545e8a6b4b092e3724cea6 Mon Sep 17 00:00:00 2001 From: Dennis Orlando Date: Fri, 1 Aug 2025 23:59:21 +0200 Subject: [PATCH] fix pallina che si muove --- .../editor/static/editor/css/editor.scss | 19 +++---------------- src/c3nav/editor/static/editor/js/editor.js | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/src/c3nav/editor/static/editor/css/editor.scss b/src/c3nav/editor/static/editor/css/editor.scss index 14602875..09031037 100644 --- a/src/c3nav/editor/static/editor/css/editor.scss +++ b/src/c3nav/editor/static/editor/css/editor.scss @@ -601,22 +601,9 @@ label.theme-color-label { /* Snap indicator styles */ .snap-indicator { + transform: scale(13.6); + transform-box: fill-box; + transform-origin: center; z-index: 1000; pointer-events: none; - animation: snap-pulse 1s infinite; } - -@keyframes snap-pulse { - 0% { - opacity: 0.8; - transform: scale(1); - } - 50% { - opacity: 1; - transform: scale(1.2); - } - 100% { - opacity: 0.8; - transform: scale(1); - } -} \ No newline at end of file diff --git a/src/c3nav/editor/static/editor/js/editor.js b/src/c3nav/editor/static/editor/js/editor.js index bf87f13d..9775fa38 100644 --- a/src/c3nav/editor/static/editor/js/editor.js +++ b/src/c3nav/editor/static/editor/js/editor.js @@ -1862,16 +1862,23 @@ editor = { _show_snap_indicator: function(latlng) { editor._clear_snap_indicators(); - - var indicator = L.circleMarker(latlng, { - radius: 4, + + var size = 0.001; // adjust this to control square size + + var bounds = [ + [latlng.lat - size, latlng.lng - size], + [latlng.lat + size, latlng.lng + size] + ]; + + var indicator = L.rectangle(bounds, { color: '#ff6b6b', + weight: 2, + lineCap: "square", fillColor: '#ff6b6b', fillOpacity: 0.8, - weight: 2, className: 'snap-indicator' }); - + editor._snap_indicator.addLayer(indicator); },