Skip to content

Commit e66f1d2

Browse files
author
HarshKhandeparkar
committed
fix: remove unused variable _
1 parent d53e761 commit e66f1d2

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

dist/gpujs-real-renderer-browser.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,19 +1069,16 @@
10691069
function _startStroke(coords, identifier) {
10701070
this._doPreview = false;
10711071
this._plot(coords[0], coords[1], this.brushSize, this.brushColor);
1072-
this._lastCoords.set(identifier, coords);
10731072
}
10741073
exports._startStroke = _startStroke;
10751074
function _endStroke(endCoords, identifier) {
10761075
this._plot(endCoords[0], endCoords[1], this.brushSize, this.brushColor);
1077-
this._lastCoords.delete(identifier);
10781076
this._doPreview = true;
10791077
}
10801078
exports._endStroke = _endStroke;
10811079
function _doStroke(coords, identifier) {
10821080
this._plot(coords[0], coords[1], this.brushSize, this.brushColor);
10831081
this._stroke(coords[0], coords[1], this.brushSize, this.brushColor, identifier);
1084-
this._lastCoords.set(identifier, coords);
10851082
}
10861083
exports._doStroke = _doStroke;
10871084
function _toolPreview(coords, identifier) {
@@ -1097,19 +1094,16 @@
10971094
function _startStroke(coords, identifier) {
10981095
this._doPreview = false;
10991096
this._plot(coords[0], coords[1], this.eraserSize, this.bgColor);
1100-
this._lastCoords.set(identifier, coords);
11011097
}
11021098
exports._startStroke = _startStroke;
11031099
function _endStroke(endCoords, identifier) {
11041100
this._doPreview = true;
11051101
this._plot(endCoords[0], endCoords[1], this.eraserSize, this.bgColor);
1106-
this._lastCoords.delete(identifier);
11071102
}
11081103
exports._endStroke = _endStroke;
11091104
function _doStroke(coords, identifier) {
11101105
this._plot(coords[0], coords[1], this.eraserSize, this.bgColor);
11111106
this._stroke(coords[0], coords[1], this.eraserSize, this.bgColor, identifier);
1112-
this._lastCoords.set(identifier, coords);
11131107
}
11141108
exports._doStroke = _doStroke;
11151109
function _toolPreview(coords, identifier) {
@@ -1128,19 +1122,16 @@
11281122
var _startCoords = new Map(); /* key -> identifier, value -> coordinate*/
11291123
function _startStroke(coords, identifier) {
11301124
this._plot(coords[0], coords[1], this.brushSize, this.brushColor);
1131-
this._lastCoords.set(identifier, coords);
11321125
_startCoords.set(identifier, coords);
11331126
}
11341127
exports._startStroke = _startStroke;
11351128
function _endStroke(endCoords, identifier) {
11361129
this.graphPixels = this._strokeKernel(this._cloneTexture(this.graphPixels), _startCoords.get(identifier), endCoords, this.brushSize, this.brushColor);
11371130
this._plot(endCoords[0], endCoords[1], this.brushSize, this.brushColor);
1138-
this._lastCoords.delete(identifier);
11391131
_startCoords.delete(identifier);
11401132
}
11411133
exports._endStroke = _endStroke;
11421134
function _doStroke(coords, identifier) {
1143-
this._lastCoords.set(identifier, coords);
11441135
}
11451136
exports._doStroke = _doStroke;
11461137
function _toolPreview(coords, identifier) {
@@ -1332,7 +1323,6 @@
13321323
_super.call(this, options) || this;
13331324
_this.tool = RealDrawBoardDefaults.RealDrawBoardDefaults.tool;
13341325
_this._isDrawing = false;
1335-
_this._ = false; // If a tool is drawing a strwoke
13361326
_this._snapshots = []; // Undo snapshots
13371327
_this._currentSnapshotIndex = 0; // Current snapshot
13381328
/** key -> identifier, value -> coordinate
@@ -1366,16 +1356,20 @@
13661356
_this.canvas.addEventListener('mousemove', _this._mouseMoveEventListener);
13671357
if (_this._currentSnapshotIndex < _this._snapshots.length - 1 && _this._maxSnapshots > 0)
13681358
_this._snapshots.splice(_this._currentSnapshotIndex + 1); // Delete all redo snapshots
1369-
_this._startStroke(_this._getMouseCoords(e), 'mouse');
1359+
var coords = _this._getMouseCoords(e);
1360+
_this._startStroke(coords, 'mouse');
1361+
_this._lastCoords.set('mouse', coords);
13701362
}
13711363
};
13721364
_this._mouseUpEventListener = function (e) {
13731365
if (e.button === 0 /* Left Click */) {
13741366
var endCoords = _this._getMouseCoords(e);
13751367
_this.canvas.removeEventListener('mousemove', _this._mouseMoveEventListener);
13761368
_this._removeDOMEvents();
1377-
if (_this._lastCoords.has('mouse'))
1369+
if (_this._lastCoords.has('mouse')) {
13781370
_this._endStroke(endCoords, 'mouse');
1371+
_this._lastCoords.delete('mouse');
1372+
}
13791373
_this._display(_this.graphPixels);
13801374
setTimeout(function () {
13811375
if (_this._maxSnapshots > 0)
@@ -1393,6 +1387,7 @@
13931387
if (_this._lastCoords.has('mouse')) {
13941388
_this._removeDOMEvents();
13951389
_this._endStroke(_this._getMouseCoords(e), 'mouse');
1390+
_this._lastCoords.delete('mouse');
13961391
_this._display(_this.graphPixels);
13971392
setTimeout(function () {
13981393
if (_this._maxSnapshots > 0)
@@ -1408,6 +1403,7 @@
14081403
_this._mouseMoveEventListener = function (e) {
14091404
var coords = _this._getMouseCoords(e);
14101405
_this._doStroke(coords, 'mouse');
1406+
_this._lastCoords.set('mouse', coords);
14111407
};
14121408
_this._previewMouseMoveEventListener = function (e) {
14131409
var coords = _this._getMouseCoords(e);
@@ -1424,12 +1420,16 @@
14241420
for (var i = 0; i < e.touches.length; i++) {
14251421
if (_this._currentSnapshotIndex < _this._snapshots.length - 1 && _this._maxSnapshots > 0)
14261422
_this._snapshots.splice(_this._currentSnapshotIndex + 1); // Delete all redo snapshots
1427-
_this._startStroke(_this._getTouchCoords(e.touches.item(i)), e.touches.item(i).identifier.toString());
1423+
var coords = _this._getTouchCoords(e.touches.item(i));
1424+
_this._startStroke(coords, e.touches.item(i).identifier.toString());
1425+
_this._lastCoords.set(e.touches.item(i).identifier.toString(), coords);
14281426
}
14291427
};
14301428
_this._touchEndEventListener = function (e) {
14311429
for (var i = 0; i < e.changedTouches.length; i++) {
1432-
_this._endStroke(_this._getTouchCoords(e.changedTouches.item(i)), e.changedTouches.item(i).identifier.toString());
1430+
var coords = _this._getTouchCoords(e.changedTouches.item(i));
1431+
_this._endStroke(coords, e.changedTouches.item(i).identifier.toString());
1432+
_this._lastCoords.delete(e.changedTouches.item(i).identifier.toString());
14331433
}
14341434
setTimeout(function () {
14351435
if (_this._maxSnapshots > 0)
@@ -1443,7 +1443,9 @@
14431443
};
14441444
_this._touchMoveEventListener = function (e) {
14451445
for (var i = 0; i < e.touches.length; i++) {
1446-
_this._doStroke(_this._getTouchCoords(e.touches.item(i)), e.touches.item(i).identifier.toString());
1446+
var coords = _this._getTouchCoords(e.touches.item(i));
1447+
_this._doStroke(coords, e.touches.item(i).identifier.toString());
1448+
_this._lastCoords.set(e.touches.item(i).identifier.toString(), coords);
14471449
}
14481450
};
14491451
_this._previewTouchMoveEventListener = function (e) {

0 commit comments

Comments
 (0)