mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-02-20 11:42:36 +01:00
Changes
This commit is contained in:
parent
c67c2c34de
commit
514581a2b4
@ -114,10 +114,10 @@ export class Nitro extends Application implements INitro
|
||||
canvas.className = 'client-canvas';
|
||||
|
||||
const instance = new this(new NitroCore(), {
|
||||
autoDensity: true,
|
||||
resolution: window.devicePixelRatio,
|
||||
width: window.innerWidth,
|
||||
height: window.innerHeight,
|
||||
autoDensity: false,
|
||||
resolution: 1,
|
||||
width: window.innerWidth * window.devicePixelRatio,
|
||||
height: window.innerHeight * window.devicePixelRatio,
|
||||
view: canvas
|
||||
});
|
||||
|
||||
@ -400,12 +400,12 @@ export class Nitro extends Application implements INitro
|
||||
|
||||
public get width(): number
|
||||
{
|
||||
return (this.renderer.width / this.renderer.resolution);
|
||||
return this.renderer.width;
|
||||
}
|
||||
|
||||
public get height(): number
|
||||
{
|
||||
return (this.renderer.height / this.renderer.resolution);
|
||||
return this.renderer.height;
|
||||
}
|
||||
|
||||
public get ticker(): Ticker
|
||||
|
@ -1519,6 +1519,9 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
|
||||
|
||||
if(!screenPoint) return null;
|
||||
|
||||
screenPoint.x = Math.round(screenPoint.x);
|
||||
screenPoint.y = Math.round(screenPoint.y);
|
||||
|
||||
rectangle.x = (rectangle.x * scale);
|
||||
rectangle.y = (rectangle.y * scale);
|
||||
rectangle.width = (rectangle.width * scale);
|
||||
@ -1532,8 +1535,8 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
|
||||
|
||||
if(!canvas) return null;
|
||||
|
||||
rectangle.x += ((canvas.width / 2) + canvas.screenOffsetX);
|
||||
rectangle.y += ((canvas.height / 2) + canvas.screenOffsetY);
|
||||
rectangle.x += (Math.round(canvas.width / 2) + canvas.screenOffsetX);
|
||||
rectangle.y += (Math.round(canvas.height / 2) + canvas.screenOffsetY);
|
||||
|
||||
return rectangle;
|
||||
}
|
||||
@ -2732,6 +2735,9 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
|
||||
screenPoint.x += ((renderingCanvas.width / 2) + renderingCanvas.screenOffsetX);
|
||||
screenPoint.y += ((renderingCanvas.height / 2) + renderingCanvas.screenOffsetY);
|
||||
|
||||
screenPoint.x = Math.round(screenPoint.x);
|
||||
screenPoint.y = Math.round(screenPoint.y);
|
||||
|
||||
return screenPoint;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user