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