Skip to content
This repository was archived by the owner on Jan 4, 2021. It is now read-only.

Commit 3d9f281

Browse files
author
DEWITTE Pierre-Alban
committed
[DEV] Improve math undo redo
1 parent f319ca9 commit 3d9f281

File tree

4 files changed

+8
-39
lines changed

4 files changed

+8
-39
lines changed

dist/myscript.js

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12692,40 +12692,6 @@ MyScript = {
1269212692
}
1269312693
};
1269412694

12695-
/**
12696-
* Return non-scratched out components
12697-
*
12698-
* @private
12699-
* @param components
12700-
* @param scratchOutResults
12701-
* @returns {*}
12702-
*/
12703-
var _removeMathScratchOut = function (components, scratchOutResults) {
12704-
if (!scratchOutResults || scratchOutResults.length === 0) {
12705-
return components;
12706-
}
12707-
12708-
var cloneComponents = components.slice(0);
12709-
var componentsToRemove = [];
12710-
12711-
for (var k in scratchOutResults) {
12712-
for (var n in scratchOutResults[k].getErasedInkRanges()) {
12713-
componentsToRemove.push(scratchOutResults[k].getErasedInkRanges()[n].getComponent());
12714-
}
12715-
for (var p in scratchOutResults[k].getInkRanges()) {
12716-
componentsToRemove.push(scratchOutResults[k].getInkRanges()[p].getComponent());
12717-
}
12718-
}
12719-
12720-
componentsToRemove.sort(function (a, b) {
12721-
return b - a;
12722-
});
12723-
12724-
for (var z in componentsToRemove) {
12725-
cloneComponents.splice(componentsToRemove[z], 1);
12726-
}
12727-
return cloneComponents;
12728-
};
1272912695

1273012696
/**
1273112697
* Return non-scratched out components
@@ -14247,6 +14213,9 @@ MyScript = {
1424714213
*/
1424814214
InkPaper.prototype.undo = function () {
1424914215
if (this.canUndo()) {
14216+
this._components.forEach(function(stroke){
14217+
stroke.scratchedStroke = false;
14218+
});
1425014219
this._redoComponents.push(this._components.pop());
1425114220

1425214221
this._clearRESTRecognition(this._instanceId);

dist/myscript.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/myscript.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/myscript.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)