chore: alpha
This commit is contained in:
parent
77442eb5c7
commit
66685b8b00
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user