chore: alpha

This commit is contained in:
cha0s 2019-04-04 20:42:11 -04:00
parent 77442eb5c7
commit 66685b8b00

View File

@ -156,6 +156,16 @@ export class Stage extends Container {
return stageEvent;
}
transformCanvasPosition(position) {
const rect = this.renderer.element.getBoundingClientRect();
const topLeft = [rect.x, rect.y];
const offset = Vector.sub(position, topLeft);
return Vector.div(
Vector.scale(offset, this._transformRatio),
this.scale,
);
}
transformEventPosition(event) {
let position;
if (event instanceof PointerEvent) {
@ -169,16 +179,6 @@ export class Stage extends Container {
return this.transformCanvasPosition(position);
}
transformCanvasPosition(position) {
const rect = this.renderer.element.getBoundingClientRect();
const topLeft = [rect.x, rect.y];
const offset = Vector.sub(position, topLeft);
return Vector.div(
Vector.scale(offset, this._transformRatio),
this.scale,
);
}
}
export class StageEvent {