Changed the zoom relative level for the SVG overlay to avoid issues at higher zoom levels (probably due to rounding errors).

This commit is contained in:
vdv committed 2022-09-21 15:47:57 +02:00
1 parent 7808b7db7e
commit f0cf255f14
2 files changed
+7 -6

No files matched your search

+3 -4
View File
@@ -1,6 +1,6 @@
import React, { Fragment } from 'react';
import { useSelector } from 'react-redux';
import { MapState } from '../../store/map';
import { MapState, zoom0 } from '../../store/map';
interface WhiteboardProps {
children?: any;
@@ -17,11 +17,10 @@ const Whiteboard: React.FC<WhiteboardProps> = (props: WhiteboardProps) => {
transform={`scale(${whiteBoardState.scale}) translate(${whiteBoardState.translation.x},${whiteBoardState.translation.y})`}
>
<circle
cx='0.7154276391666667'
cy='0.6137091783430285'
cx={0.7154276391666667 * 2**zoom0}
cy={0.6137091783430285 * 2**zoom0}
r={10 / whiteBoardState.scale}
fill='green'
vector-effect='non-scaling-size'
></circle>
{props.children}
</g>