Skip to content

Commit e89285b

Browse files
committed
merge DVF-2960-marker-fill-fix
1 parent 8fe2bc5 commit e89285b

File tree

3 files changed

+28
-16
lines changed

3 files changed

+28
-16
lines changed

src/vector/Element.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,13 +1091,21 @@ acgraph.vector.Element.prototype.render = function() {
10911091
this.drag(this.draggable_);
10921092
}
10931093

1094+
this.beforeRenderInternal();
1095+
10941096
this.renderInternal();
10951097

10961098
this.isRendering_ = false;
10971099
return this;
10981100
};
10991101

11001102

1103+
/**
1104+
* Before render internal hook.
1105+
*/
1106+
acgraph.vector.Element.prototype.beforeRenderInternal = function() {};
1107+
1108+
11011109
/**
11021110
* Renders element properties supposing DOM is created.
11031111
* @protected

src/vector/PathBase.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/vector/Shape.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,18 @@ acgraph.vector.Shape.prototype.strokeThickness = function(opt_value) {
145145
//
146146
//----------------------------------------------------------------------------------------------------------------------
147147
/** @inheritDoc */
148-
acgraph.vector.Shape.prototype.renderInternal = function() {
148+
acgraph.vector.Shape.prototype.beforeRenderInternal = function() {
149149
if (this.boundsAffectedColors_ && this.hasDirtyState(acgraph.vector.Element.DirtyState.DATA)) {
150150
if (!!(this.boundsAffectedColors_ & 1))
151151
this.setDirtyState(acgraph.vector.Element.DirtyState.FILL);
152152
if (!!(this.boundsAffectedColors_ & 2))
153153
this.setDirtyState(acgraph.vector.Element.DirtyState.STROKE);
154154
}
155+
};
156+
155157

158+
/** @inheritDoc */
159+
acgraph.vector.Shape.prototype.renderInternal = function() {
156160
goog.base(this, 'renderInternal');
157161

158162
// Apply stroke and fill settings if they were changed

0 commit comments

Comments
 (0)