1
0
Fork 0
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:
Starbeamrainbowlabs 2017-06-11 22:01:12 +01:00
parent 00117a35a9
commit b043362f29

View file

@ -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)