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

@ -66,7 +66,7 @@ import { MainMap } from '~/constants/map';
import { EDITOR_INITIAL_STATE } from '.';
import { Unwrap } from '~/utils/middleware';
import uuid from 'uuid';
import { getRandomColor } from '~/utils/dom';
import { getRandomColor, getAdaptiveScale } from '~/utils/dom';
const hideLoader = () => {
document.getElementById('loader').style.opacity = String(0);
@ -141,7 +141,11 @@ function* getRenderData() {
yield composeArrows({ points, ctx });
yield composeDistMark({ ctx, points, distance });
yield composeStickers({ stickers: sticker_points, ctx, zoom: MainMap.getZoom() / 13 });
yield composeStickers({
stickers: sticker_points,
ctx,
zoom: getAdaptiveScale(MainMap.getZoom()),
});
yield put(editorSetRenderer({ info: 'Готово', progress: 1 }));