logo selecting

This commit is contained in:
muerwre 2018-08-27 12:00:43 +07:00
parent 898176a68f
commit 0c6dc387de
12 changed files with 104 additions and 17 deletions

View file

@ -4,7 +4,7 @@ import { MODES } from '$constants/modes';
import { Stickers } from '$modules/Stickers';
import { Router } from '$modules/Router';
import { Shotter } from '$modules/Shotter';
import { LOGOS } from '$constants/logos';
import { DEFAULT_LOGO } from '$constants/logos';
export class Editor {
constructor({
@ -14,7 +14,10 @@ export class Editor {
setRouterPoints,
setTotalDist,
setActiveSticker,
setLogo,
}) {
this.logo = DEFAULT_LOGO;
this.map = new Map({ container });
const {
@ -30,9 +33,6 @@ export class Editor {
});
this.shotter = new Shotter({ map });
this.setMode = setMode;
this.mode = mode;
this.switches = {
[MODES.POLY]: {
start: this.poly.continue,
@ -56,6 +56,9 @@ export class Editor {
this.activeSticker = null;
this.setActiveSticker = setActiveSticker;
this.setLogo = setLogo;
this.setMode = setMode;
this.mode = mode;
map.addEventListener('mouseup', this.onClick);
map.addEventListener('dragstart', () => lockMapClicks(true));
@ -152,5 +155,11 @@ export class Editor {
this.setSticker(null);
this.changeMode(MODES.NONE);
};
changeLogo = logo => {
this.logo = logo;
this.setLogo(logo);
this.changeMode(MODES.NONE);
}
}