1
0
Fork 0

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:
Starbeamrainbowlabs 2017-07-09 15:28:12 +01:00
parent 59db921100
commit af8fe9bbc2
2 changed files with 6 additions and 3 deletions

View File

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

View File

@ -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;
}