fix incorrect remote cursor scaling and make local cursor visible again after it has been moved after being hidden due to inactivity

This commit is contained in:
Finn Böger 2020-04-28 16:15:19 +02:00
parent bf189b2d48
commit a1a55804cb

View file

@ -123,7 +123,6 @@ function handleMarker(evt) {
} }
}; };
if (Tools.showMarker) { if (Tools.showMarker) {
moveMarker(message.data); moveMarker(message.data);
} }
@ -146,6 +145,7 @@ function moveMarker(message) {
Tools.svg.appendChild(cursor); Tools.svg.appendChild(cursor);
//cursor.setAttributeNS(null, "r", Tools.getSize()); //cursor.setAttributeNS(null, "r", Tools.getSize());
cursor.r.baseVal.value=Tools.getSize()/2; cursor.r.baseVal.value=Tools.getSize()/2;
cursor.setAttributeNS(null, "visibility", "visible");
cursor.style.transform = "translate(" + message.x + "px, " + message.y + "px)"; cursor.style.transform = "translate(" + message.x + "px, " + message.y + "px)";
} }
@ -168,7 +168,7 @@ function moveCursor(message) {
} }
cursor.setAttributeNS(null, "fill", message.c); cursor.setAttributeNS(null, "fill", message.c);
//TODO: scaling is broken on mobile //TODO: scaling is broken on mobile
cursor.setAttributeNS(null, "r", (message.s/2)*Tools.getScale()); cursor.setAttributeNS(null, "r", (message.s/2));
cursor.setAttributeNS(null, "visibility", "visible"); cursor.setAttributeNS(null, "visibility", "visible");
cursor.style.transform = "translate(" + message.x + "px, " + message.y + "px)"; cursor.style.transform = "translate(" + message.x + "px, " + message.y + "px)";