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 +3
-34
lines changed Expand file tree Collapse file tree 2 files changed +3
-34
lines changed Original file line number Diff line number Diff line change 731731 */
732732 InkPaper . prototype . undo = function ( ) {
733733 if ( this . canUndo ( ) ) {
734+ this . _components . forEach ( function ( stroke ) {
735+ stroke . scratchedStroke = false ;
736+ } ) ;
734737 this . _redoComponents . push ( this . _components . pop ( ) ) ;
735738
736739 this . _clearRESTRecognition ( this . _instanceId ) ;
Original file line number Diff line number Diff line change 5959 }
6060 } ;
6161
62- /**
63- * Return non-scratched out components
64- *
65- * @private
66- * @param components
67- * @param scratchOutResults
68- * @returns {* }
69- */
70- var _removeMathScratchOut = function ( components , scratchOutResults ) {
71- if ( ! scratchOutResults || scratchOutResults . length === 0 ) {
72- return components ;
73- }
74-
75- var cloneComponents = components . slice ( 0 ) ;
76- var componentsToRemove = [ ] ;
77-
78- for ( var k in scratchOutResults ) {
79- for ( var n in scratchOutResults [ k ] . getErasedInkRanges ( ) ) {
80- componentsToRemove . push ( scratchOutResults [ k ] . getErasedInkRanges ( ) [ n ] . getComponent ( ) ) ;
81- }
82- for ( var p in scratchOutResults [ k ] . getInkRanges ( ) ) {
83- componentsToRemove . push ( scratchOutResults [ k ] . getInkRanges ( ) [ p ] . getComponent ( ) ) ;
84- }
85- }
86-
87- componentsToRemove . sort ( function ( a , b ) {
88- return b - a ;
89- } ) ;
90-
91- for ( var z in componentsToRemove ) {
92- cloneComponents . splice ( componentsToRemove [ z ] , 1 ) ;
93- }
94- return cloneComponents ;
95- } ;
9662
9763 /**
9864 * Return non-scratched out components
You can’t perform that action at this time.
0 commit comments