mirror of
https://github.com/sbrl/Nibriboard.git
synced 2018-01-10 21:33:49 +00:00
[client] Account for zoom when rendering chunks.
This commit is contained in:
parent
00117a35a9
commit
b043362f29
1 changed files with 1 additions and 1 deletions
|
@ -221,6 +221,7 @@ class BoardWindow extends EventEmitter
|
||||||
context.clearRect(0, 0, canvas.width, canvas.height);
|
context.clearRect(0, 0, canvas.width, canvas.height);
|
||||||
|
|
||||||
context.save();
|
context.save();
|
||||||
|
context.scale(this.viewport.zoomLevel, this.viewport.zoomLevel);
|
||||||
|
|
||||||
// Draw the grid if it's enabled
|
// Draw the grid if it's enabled
|
||||||
if(this.displayGrid)
|
if(this.displayGrid)
|
||||||
|
@ -243,7 +244,6 @@ class BoardWindow extends EventEmitter
|
||||||
renderGrid(canvas, context)
|
renderGrid(canvas, context)
|
||||||
{
|
{
|
||||||
context.save();
|
context.save();
|
||||||
context.scale(this.viewport.zoomLevel, this.viewport.zoomLevel);
|
|
||||||
|
|
||||||
|
|
||||||
for(let ax = (this.viewport.x + (this.gridSize - (this.viewport.x % this.gridSize))) - this.gridSize; ax < (this.viewport.x + this.viewport.width); ax += this.gridSize)
|
for(let ax = (this.viewport.x + (this.gridSize - (this.viewport.x % this.gridSize))) - this.gridSize; ax < (this.viewport.x + this.viewport.width); ax += this.gridSize)
|
||||||
|
|
Loading…
Reference in a new issue