This repository was archived by the owner on Jan 4, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 731731 */
732732 InkPaper . prototype . undo = function ( ) {
733733 if ( this . canUndo ( ) ) {
734+ //Remove the scratched state for Math strokes
734735 this . _components . forEach ( function ( stroke ) {
735736 stroke . scratchedStroke = false ;
736737 } ) ;
738+ //Remove the latsModel used for Shape
739+ this . updatedModel = undefined ;
740+
737741 this . _redoComponents . push ( this . _components . pop ( ) ) ;
738742
739743 this . _clearRESTRecognition ( this . _instanceId ) ;
935939 } ;
936940
937941 InkPaper . prototype . _renderResult = function ( data ) {
938- this . _selectedRenderer . drawRecognitionResult ( this . getComponents ( ) . concat ( this . _components ) , data ? data . getDocument ( ) : undefined ) ;
939-
942+ this . updatedModel = this . _selectedRenderer . drawRecognitionResult ( this . getComponents ( ) . concat ( this . _components ) , data ? data . getDocument ( ) : undefined ) ;
940943 this . _onResult ( data ) ;
941944 return data ;
942945 } ;
10451048 this . _selectedRenderer . drawStaff ( this . _selectedRecognizer . getParameters ( ) . getStaff ( ) ) ;
10461049 }
10471050 }
1048- this . _selectedRenderer . drawComponents ( this . getComponents ( ) . concat ( this . _components ) ) ;
1051+ if ( this . _selectedRecognizer instanceof scope . ShapeRecognizer && this . updatedModel ) {
1052+ this . _selectedRenderer . drawRecognitionResult ( this . updatedModel . components , this . updatedModel . document ) ;
1053+ } else {
1054+ this . _selectedRenderer . drawComponents ( this . getComponents ( ) . concat ( this . _components ) ) ;
1055+ }
10491056 } ;
10501057
10511058 /**
Original file line number Diff line number Diff line change 4747 } else {
4848 this . drawComponents ( components ) ;
4949 }
50+ return { components : components , document : document }
5051 } ;
5152
5253 /**
You can’t perform that action at this time.
0 commit comments