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

Commit f08e45f

Browse files
author
DEWITTE Pierre-Alban
committed
[DEV] Manage resize with shapes
1 parent 568b1fc commit f08e45f

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

dist/myscript.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12292,6 +12292,7 @@ MyScript = {
1229212292
} else {
1229312293
this.drawComponents(components);
1229412294
}
12295+
return {components : components, document : document}
1229512296
};
1229612297

1229712298
/**
@@ -14213,9 +14214,13 @@ MyScript = {
1421314214
*/
1421414215
InkPaper.prototype.undo = function () {
1421514216
if (this.canUndo()) {
14217+
//Remove the scratched state for Math strokes
1421614218
this._components.forEach(function(stroke){
1421714219
stroke.scratchedStroke = false;
1421814220
});
14221+
//Remove the latsModel used for Shape
14222+
this.updatedModel = undefined;
14223+
1421914224
this._redoComponents.push(this._components.pop());
1422014225

1422114226
this._clearRESTRecognition(this._instanceId);
@@ -14417,8 +14422,7 @@ MyScript = {
1441714422
};
1441814423

1441914424
InkPaper.prototype._renderResult = function (data) {
14420-
this._selectedRenderer.drawRecognitionResult(this.getComponents().concat(this._components), data? data.getDocument(): undefined);
14421-
14425+
this.updatedModel = this._selectedRenderer.drawRecognitionResult(this.getComponents().concat(this._components), data? data.getDocument(): undefined);
1442214426
this._onResult(data);
1442314427
return data;
1442414428
};
@@ -14527,7 +14531,11 @@ MyScript = {
1452714531
this._selectedRenderer.drawStaff(this._selectedRecognizer.getParameters().getStaff());
1452814532
}
1452914533
}
14530-
this._selectedRenderer.drawComponents(this.getComponents().concat(this._components));
14534+
if(this._selectedRecognizer instanceof scope.ShapeRecognizer && this.updatedModel){
14535+
this._selectedRenderer.drawRecognitionResult(this.updatedModel.components, this.updatedModel.document);
14536+
} else {
14537+
this._selectedRenderer.drawComponents(this.getComponents().concat(this._components));
14538+
}
1453114539
};
1453214540

1453314541
/**

0 commit comments

Comments
 (0)