mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-01-31 11:12:35 +01:00
Update setRoomInstanceRenderingCanvasOffset
This commit is contained in:
parent
d7d49e5974
commit
cda1946c29
@ -666,10 +666,15 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
|
|||||||
|
|
||||||
if(!renderingCanvas || !point) return false;
|
if(!renderingCanvas || !point) return false;
|
||||||
|
|
||||||
this.events.dispatchEvent(new RoomDragEvent(roomId, -(renderingCanvas.screenOffsetX - point.x), -(renderingCanvas.screenOffsetY - point.y)));
|
const x = ~~(point.x);
|
||||||
|
const y = ~~(point.y);
|
||||||
|
|
||||||
renderingCanvas.screenOffsetX = point.x;
|
if((renderingCanvas.screenOffsetX === x) && (renderingCanvas.screenOffsetY === y)) return;
|
||||||
renderingCanvas.screenOffsetY = point.y;
|
|
||||||
|
this.events.dispatchEvent(new RoomDragEvent(roomId, -(renderingCanvas.screenOffsetX - x), -(renderingCanvas.screenOffsetY - y)));
|
||||||
|
|
||||||
|
renderingCanvas.screenOffsetX = x;
|
||||||
|
renderingCanvas.screenOffsetY = y;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1187,7 +1192,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this._activeRoomIsDragged)
|
if(this._activeRoomWasDragged)
|
||||||
{
|
{
|
||||||
const renderingCanvas = this.getRoomInstanceRenderingCanvas(this._activeRoomId, 1);
|
const renderingCanvas = this.getRoomInstanceRenderingCanvas(this._activeRoomId, 1);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user