mirror of
https://github.com/sbrl/Nibriboard.git
synced 2018-01-10 21:33:49 +00:00
Get live line rendering working for *other* clients! Yay!
It _works_. It actually _works_! I'm so happy right now :D It's taken 204 commits and 6 months to get to this point. Wow.
This commit is contained in:
parent
59db921100
commit
af8fe9bbc2
2 changed files with 6 additions and 3 deletions
|
@ -3,6 +3,7 @@
|
|||
window.EventEmitter = require("event-emitter-es6");
|
||||
|
||||
import OtherClient from './OtherClient';
|
||||
import Vector from './Utilities/Vector';
|
||||
|
||||
class ClientManager extends EventEmitter
|
||||
{
|
||||
|
@ -10,8 +11,8 @@ class ClientManager extends EventEmitter
|
|||
{
|
||||
super();
|
||||
|
||||
this.otherClientCursorSize = 25;
|
||||
this.otherClientCursorWidth = 2;
|
||||
this.otherClientCursorSize = 15;
|
||||
this.otherClientCursorWidth = 4;
|
||||
|
||||
this.otherClients = new Map();
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ class OtherClient
|
|||
context.lineTo(0, manager.otherClientCursorSize);
|
||||
|
||||
context.strokeStyle = this.Colour;
|
||||
context.lineWidth = manager.otherCursorWidth;
|
||||
context.lineWidth = manager.otherClientCursorWidth;
|
||||
context.stroke();
|
||||
|
||||
context.restore();
|
||||
|
@ -79,6 +79,7 @@ class OtherClient
|
|||
for(let point of linePoints)
|
||||
context.lineTo(point.x, point.y);
|
||||
|
||||
context.lineCap = "round";
|
||||
context.strokeStyle = lineData.Colour;
|
||||
context.lineWidth = lineData.Width;
|
||||
context.stroke();
|
||||
|
@ -104,6 +105,7 @@ class OtherClient
|
|||
if(typeof this.currentLines[lineData.LineId] != "undefined")
|
||||
throw new Error(`Error: The line with the id ${lineData.LineId} already exists.`);
|
||||
|
||||
lineData.Points = [];
|
||||
this.currentLines[lineData.LineId] = lineData;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue