remove unused and buggy code
This commit is contained in:
parent
728067ba14
commit
d4b0c0fe13
@ -229,7 +229,7 @@ const whiteboard = {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
if (_this.tool == "hand" && _this.drawFlag) {
|
if (_this.tool == "hand" && _this.drawFlag) {
|
||||||
// window.requestAnimationFrame(function () {
|
// window.requestAnimationFrame(function () { //Maybe we need to implement something here so its less laggy
|
||||||
let currentPos = Point.fromEvent(e);
|
let currentPos = Point.fromEvent(e);
|
||||||
let xDif = _this.startCoords.x - currentPos.x;
|
let xDif = _this.startCoords.x - currentPos.x;
|
||||||
let yDif = _this.startCoords.y - currentPos.y;
|
let yDif = _this.startCoords.y - currentPos.y;
|
||||||
@ -295,20 +295,7 @@ const whiteboard = {
|
|||||||
});
|
});
|
||||||
_this.svgContainer.find("line").remove();
|
_this.svgContainer.find("line").remove();
|
||||||
} else if (_this.tool === "hand") {
|
} else if (_this.tool === "hand") {
|
||||||
let xDif = _this.startCoords.x - currentPos.x;
|
//We dont need to do anything here
|
||||||
let yDif = _this.startCoords.y - currentPos.y;
|
|
||||||
|
|
||||||
_this.viewCoords.x -= xDif;
|
|
||||||
_this.viewCoords.y -= yDif;
|
|
||||||
|
|
||||||
const dbCp = JSON.parse(JSON.stringify(_this.drawBuffer)); // Copy the buffer
|
|
||||||
_this.canvas.width = $(window).width();
|
|
||||||
_this.canvas.height = $(window).height(); // Set new canvas height
|
|
||||||
_this.drawBuffer = [];
|
|
||||||
_this.textContainer.empty();
|
|
||||||
_this.loadData(dbCp); // draw old content in
|
|
||||||
|
|
||||||
console.log(_this.viewCoords.x, _this.viewCoords.y);
|
|
||||||
} else if (_this.tool === "pen") {
|
} else if (_this.tool === "pen") {
|
||||||
_this.pushPointSmoothPen(currentPos.x, currentPos.y);
|
_this.pushPointSmoothPen(currentPos.x, currentPos.y);
|
||||||
} else if (_this.tool === "rect") {
|
} else if (_this.tool === "rect") {
|
||||||
@ -697,7 +684,6 @@ const whiteboard = {
|
|||||||
let sendArray = [];
|
let sendArray = [];
|
||||||
for (let i = 0; i < _this.penSmoothLastCoords.length; i++) {
|
for (let i = 0; i < _this.penSmoothLastCoords.length; i++) {
|
||||||
sendArray.push(_this.penSmoothLastCoords[i]);
|
sendArray.push(_this.penSmoothLastCoords[i]);
|
||||||
console.log(sendArray);
|
|
||||||
if (i % 2 == 0) {
|
if (i % 2 == 0) {
|
||||||
sendArray[i] -= this.viewCoords.x;
|
sendArray[i] -= this.viewCoords.x;
|
||||||
} else {
|
} else {
|
||||||
@ -1321,9 +1307,7 @@ const whiteboard = {
|
|||||||
} else if (tool === "cursor" && _this.settings) {
|
} else if (tool === "cursor" && _this.settings) {
|
||||||
if (content["event"] === "move") {
|
if (content["event"] === "move") {
|
||||||
if (_this.cursorContainer.find("." + content["username"]).length >= 1) {
|
if (_this.cursorContainer.find("." + content["username"]).length >= 1) {
|
||||||
_this.cursorContainer
|
_this.cursorContainer.find("." + content["username"]).css({
|
||||||
.find("." + content["username"])
|
|
||||||
.css({
|
|
||||||
left: data[0] + _this.viewCoords.x + "px",
|
left: data[0] + _this.viewCoords.x + "px",
|
||||||
top: data[1] + _this.viewCoords.y - 15 + "px",
|
top: data[1] + _this.viewCoords.y - 15 + "px",
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user