adaptive sticker scale

This commit is contained in:
Fedor Katurov 2020-02-11 15:35:13 +07:00
parent ef5cd0cdef
commit a1c55befa2
5 changed files with 22 additions and 9 deletions

View file

@ -7,6 +7,7 @@ import classNames from 'classnames';
import { DomMarker } from '~/utils/map/DomMarker';
import { createPortal } from 'react-dom';
import { MapContainer, MainMap } from '~/constants/map';
import { getAdaptiveScale } from '~/utils/dom';
interface IProps {
sticker: IStickerDump;
@ -153,7 +154,7 @@ const Sticker: React.FC<IProps> = ({
useEffect(() => {
if (!wrapper || !wrapper.current) return;
const scale = zoom / 13;
const scale = getAdaptiveScale(zoom) // adaptive zoom :-)
wrapper.current.style.transform = `scale(${scale}) perspective(1px)`
}, [zoom, wrapper]);