mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 02:56:41 +07:00
adaptive sticker scale
This commit is contained in:
parent
ef5cd0cdef
commit
a1c55befa2
5 changed files with 22 additions and 9 deletions
|
@ -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]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue