1
0
Fork 0

[client] Tidy up translations

This commit is contained in:
Starbeamrainbowlabs 2017-06-12 20:46:50 +01:00
parent 636bc0535a
commit 74a0010e59
3 changed files with 11 additions and 15 deletions

View File

@ -227,6 +227,13 @@ class BoardWindow extends EventEmitter
if(this.displayGrid)
this.renderGrid(canvas, context);
context.save();
context.translate(
-this.viewport.x,
-this.viewport.y
);
// Only render the visible chunks if the chunk cache has been created
// The chunk cache is only created once the ripple link connects successfully
// to the nibriboard server.
@ -236,7 +243,9 @@ class BoardWindow extends EventEmitter
this.renderOthers(canvas, context);
// Render the currently active line
if(typeof this.pencil !== "undefined")
this.pencil.render(this.viewport, canvas, context);
this.pencil.render(canvas, context);
context.restore();
context.restore();
}

View File

@ -54,14 +54,6 @@ class ChunkCache
(Math.floor((visibleArea.y + (visibleArea.height / visibleArea.zoomLevel)) / chunkSize) * chunkSize)
);
/*context.translate(
-Math.abs(visibleArea.x - chunkArea.x),
-Math.abs(visibleArea.y - chunkArea.y)
);*/
context.translate(
-visibleArea.x,
-visibleArea.y
);
for(let cx = chunkArea.x; cx <= chunkArea.x + chunkArea.width; cx += chunkSize)
{

View File

@ -143,17 +143,12 @@ class Pencil
* @param {HTMLCanvasElement} canvas The canvas to draw to.
* @param {CanvasRenderingContext2D} context The rendering context to use to draw to the canvas.
*/
render(visibleArea, canvas, context) {
render(canvas, context) {
if(this.currentLineSegments.length == 0)
return;
context.save();
context.translate(
-visibleArea.x,
-visibleArea.y
);
context.beginPath();
context.moveTo(this.currentLineSegments[0].x, this.currentLineSegments[0].y);
for(let i = 1; i < this.currentLineSegments.length; i++) {