fix pallina che si muove

This commit is contained in:
Dennis Orlando 2025-08-01 23:59:21 +02:00
parent 890d41b9d0
commit 354949527b
2 changed files with 15 additions and 21 deletions

View file

@ -601,22 +601,9 @@ label.theme-color-label {
/* Snap indicator styles */ /* Snap indicator styles */
.snap-indicator { .snap-indicator {
transform: scale(13.6);
transform-box: fill-box;
transform-origin: center;
z-index: 1000; z-index: 1000;
pointer-events: none; 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);
}
}

View file

@ -1862,16 +1862,23 @@ editor = {
_show_snap_indicator: function(latlng) { _show_snap_indicator: function(latlng) {
editor._clear_snap_indicators(); editor._clear_snap_indicators();
var indicator = L.circleMarker(latlng, { var size = 0.001; // adjust this to control square size
radius: 4,
var bounds = [
[latlng.lat - size, latlng.lng - size],
[latlng.lat + size, latlng.lng + size]
];
var indicator = L.rectangle(bounds, {
color: '#ff6b6b', color: '#ff6b6b',
weight: 2,
lineCap: "square",
fillColor: '#ff6b6b', fillColor: '#ff6b6b',
fillOpacity: 0.8, fillOpacity: 0.8,
weight: 2,
className: 'snap-indicator' className: 'snap-indicator'
}); });
editor._snap_indicator.addLayer(indicator); editor._snap_indicator.addLayer(indicator);
}, },