editor - viewer buttons

This commit is contained in:
muerwre 2018-08-31 16:25:42 +07:00
parent 1ecc2d2a92
commit 293f3cd7b9
5 changed files with 41 additions and 2 deletions

View file

@ -17,6 +17,7 @@ export class Editor {
setTotalDist,
setActiveSticker,
setLogo,
setEditing,
}) {
this.logo = DEFAULT_LOGO;
this.owner = null;
@ -63,6 +64,7 @@ export class Editor {
this.setActiveSticker = setActiveSticker;
this.setLogo = setLogo;
this.setMode = setMode;
this.setEditing = setEditing;
this.mode = mode;
map.addEventListener('mouseup', this.onClick);
@ -196,11 +198,13 @@ export class Editor {
startEditing = () => {
this.poly.poly.enableEdit();
this.stickers.startEditing();
this.setEditing(true);
};
stopEditing = () => {
this.poly.poly.disableEdit();
this.stickers.stopEditing();
this.setEditing(false);
};
dumpData = () => ({

View file

@ -92,6 +92,7 @@ export class Sticker {
};
estimateAngle = e => {
console.log('est');
const { x, y } = this.element.getBoundingClientRect();
const { pageX, pageY } = e;
this.angle = Math.atan2((y - pageY), (x - pageX));