Merge pull request #34 from jb-leger/smooth_cor

The last point of a line should be added with the same drawID as the …
This commit is contained in:
Cracker 2020-04-17 21:00:33 +02:00 committed by GitHub
commit f4e4c1b142
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,7 +181,9 @@ var whiteboard = {
_this.sendFunction({ "t": _this.tool, "d": [currX, currY, _this.startCoords[0], _this.startCoords[1]], "c": _this.drawcolor, "th": _this.thickness }); _this.sendFunction({ "t": _this.tool, "d": [currX, currY, _this.startCoords[0], _this.startCoords[1]], "c": _this.drawcolor, "th": _this.thickness });
_this.svgContainer.find("line").remove(); _this.svgContainer.find("line").remove();
} else if (_this.tool === "pen") { } else if (_this.tool === "pen") {
_this.drawId--;
_this.pushPointSmoothPen(currX, currY); _this.pushPointSmoothPen(currX, currY);
_this.drawId++;
} else if (_this.tool === "rect") { } else if (_this.tool === "rect") {
if (_this.pressedKeys.shift) { if (_this.pressedKeys.shift) {
if ((currY - _this.startCoords[1]) * (currX - _this.startCoords[0]) > 0) { if ((currY - _this.startCoords[1]) * (currX - _this.startCoords[0]) > 0) {