@@ -516,12 +516,12 @@ acgraph.vector.PathBase.prototype.moveToInternal = function(x, y) {
516516 this . arguments_ . push ( x , y ) ;
517517 this . currentPoint_ = this . closePoint_ = [ x , y ] ;
518518
519- // A flag is set, indicating that data is not synchronized
520- this . setDirtyState ( acgraph . vector . Element . DirtyState . DATA ) ;
521-
522519 // Borders cache is not reset as there is no extension for the time being and borders do not change
523520 this . transformedPathCache_ = null ;
524521
522+ // A flag is set, indicating that data is not synchronized
523+ this . setDirtyState ( acgraph . vector . Element . DirtyState . DATA ) ;
524+
525525 return this ;
526526} ;
527527
@@ -550,13 +550,13 @@ acgraph.vector.PathBase.prototype.lineToInternal = function(x, y, var_args) {
550550 this . count_ [ this . count_ . length - 1 ] += i / 2 ;
551551 this . currentPoint_ = [ x , y ] ;
552552
553- // A flag is set, indicating that data is not synchronized
554- this . setDirtyState ( acgraph . vector . Element . DirtyState . DATA ) ;
555-
556553 // Caches are reset
557554 this . dropBoundsCache ( ) ;
558555 this . transformedPathCache_ = null ;
559556
557+ // A flag is set, indicating that data is not synchronized
558+ this . setDirtyState ( acgraph . vector . Element . DirtyState . DATA ) ;
559+
560560 return this ;
561561} ;
562562
@@ -591,13 +591,13 @@ acgraph.vector.PathBase.prototype.curveToInternal = function(control1X, control1
591591 this . count_ [ this . count_ . length - 1 ] += i / 6 ;
592592 this . currentPoint_ = [ x , y ] ;
593593
594- // A flag is set, indicating that data is not synchronized
595- this . setDirtyState ( acgraph . vector . Element . DirtyState . DATA ) ;
596-
597594 // Caches are reset
598595 this . dropBoundsCache ( ) ;
599596 this . transformedPathCache_ = null ;
600597
598+ // A flag is set, indicating that data is not synchronized
599+ this . setDirtyState ( acgraph . vector . Element . DirtyState . DATA ) ;
600+
601601 return this ;
602602} ;
603603
@@ -773,13 +773,13 @@ acgraph.vector.PathBase.prototype.arcToInternal = function(rx, ry, fromAngle, ex
773773 this . simple_ = false ;
774774 this . currentPoint_ = [ ex , ey ] ;
775775
776- // A flag is set, indicating that data is not synchronized
777- this . setDirtyState ( acgraph . vector . Element . DirtyState . DATA ) ;
778-
779776 // Caches are reset
780777 this . dropBoundsCache ( ) ;
781778 this . transformedPathCache_ = null ;
782779
780+ // A flag is set, indicating that data is not synchronized
781+ this . setDirtyState ( acgraph . vector . Element . DirtyState . DATA ) ;
782+
783783 return this ;
784784} ;
785785
@@ -803,13 +803,13 @@ acgraph.vector.PathBase.prototype.arcToAsCurvesInternal = function(rx, ry, fromA
803803
804804 this . curveToInternal . apply ( this , curveParams ) ;
805805
806- // A flag is set, indicating that data is not synchronized
807- this . setDirtyState ( acgraph . vector . Element . DirtyState . DATA ) ;
808-
809806 // Caches are reset
810807 this . dropBoundsCache ( ) ;
811808 this . transformedPathCache_ = null ;
812809
810+ // A flag is set, indicating that data is not synchronized
811+ this . setDirtyState ( acgraph . vector . Element . DirtyState . DATA ) ;
812+
813813 return this ;
814814} ;
815815
@@ -1045,6 +1045,23 @@ acgraph.vector.PathBase.boundsCalculationMap_ = (function() {
10451045// Serialize
10461046//
10471047//----------------------------------------------------------------------------------------------------------------------
1048+ /**
1049+ * Serialize only path arguments. For copy path data purposes.
1050+ * @param {Object= } opt_data .
1051+ * @return {Object }
1052+ */
1053+ acgraph . vector . PathBase . prototype . serializePathArgs = function ( opt_data ) {
1054+ var data = opt_data || { } ;
1055+ data [ 'closePoint' ] = this . closePoint_ ? this . closePoint_ . slice ( ) : [ ] ;
1056+ data [ 'currentPoint' ] = this . currentPoint_ ? this . currentPoint_ . slice ( ) : [ ] ;
1057+ data [ 'segments' ] = this . segments_ . slice ( ) ;
1058+ data [ 'count' ] = this . count_ . slice ( ) ;
1059+ data [ 'arguments' ] = this . arguments_ . slice ( ) ;
1060+
1061+ return data ;
1062+ } ;
1063+
1064+
10481065/** @inheritDoc */
10491066acgraph . vector . PathBase . prototype . deserialize = function ( data ) {
10501067 this . closePoint_ = data [ 'closePoint' ] ;
@@ -1061,11 +1078,7 @@ acgraph.vector.PathBase.prototype.deserialize = function(data) {
10611078acgraph . vector . PathBase . prototype . serialize = function ( ) {
10621079 var data = goog . base ( this , 'serialize' ) ;
10631080 data [ 'type' ] = 'path' ;
1064- data [ 'closePoint' ] = this . closePoint_ ? this . closePoint_ . slice ( ) : [ ] ;
1065- data [ 'currentPoint' ] = this . currentPoint_ ? this . currentPoint_ . slice ( ) : [ ] ;
1066- data [ 'segments' ] = this . segments_ . slice ( ) ;
1067- data [ 'count' ] = this . count_ . slice ( ) ;
1068- data [ 'arguments' ] = this . arguments_ . slice ( ) ;
1081+ data = this . serializePathArgs ( data ) ;
10691082 return data ;
10701083} ;
10711084
0 commit comments