Skip to content

Commit 248fc31

Browse files
committed
DVF-3404-pie-chart-outline and DVF-3445-adding-content-to-center-of-donut
1 parent 5670beb commit 248fc31

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

src/vector/Clip.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
goog.provide('acgraph.vector.Clip');
2+
goog.require('acgraph.vector.Circle');
23
goog.require('acgraph.vector.ILayer');
4+
goog.require('acgraph.vector.Path');
5+
goog.require('acgraph.vector.Rect');
36
goog.require('goog.Disposable');
47
goog.require('goog.array');
58
goog.require('goog.math.Rect');

src/vector/Element.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,7 @@ acgraph.vector.Element.prototype.render = function() {
10461046
this.renderInternal();
10471047

10481048
this.isRendering_ = false;
1049+
10491050
return this;
10501051
};
10511052

src/vector/svg/Renderer.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,18 +1082,24 @@ acgraph.vector.svg.Renderer.prototype.applyFill = function(element) {
10821082
var defs = element.getStage().getDefs();
10831083
var pathPrefix = 'url(' + acgraph.getReference() + '#';
10841084

1085+
// DVF-1729 fix
1086+
// because internet explorer converts fill-opacity "0.00001" to "1e-5" that is not css-compatible
1087+
// and export server can't generate proper image.
1088+
if (fill && fill['opacity'] && fill['opacity'] <= 0.0001 && goog.userAgent.IE && goog.userAgent.isVersionOrHigher('9'))
1089+
fill['opacity'] = 0.0001;
1090+
10851091
if (goog.isString(fill)) {
10861092
this.setAttr(element.domElement(), 'fill', /** @type {string} */(fill));
10871093
this.removeAttr(element.domElement(), 'fill-opacity');
10881094
} else if (goog.isArray(fill['keys']) && fill['cx'] && fill['cy']) {
10891095
this.setAttr(element.domElement(), 'fill', pathPrefix +
10901096
this.renderRadialGradient(/** @type {acgraph.vector.RadialGradientFill} */(fill), defs) + ')');
1091-
this.removeAttr(element.domElement(), 'fill-opacity');
1097+
this.setAttr(element.domElement(), 'fill-opacity', goog.isDef(fill['opacity']) ? fill['opacity'] : 1);
10921098
} else if (goog.isArray(fill['keys'])) {
10931099
if (!element.getBounds()) return;
10941100
this.setAttr(element.domElement(), 'fill',
10951101
pathPrefix + this.renderLinearGradient(/** @type {acgraph.vector.LinearGradientFill} */(fill), defs, element.getBounds()) + ')');
1096-
this.removeAttr(element.domElement(), 'fill-opacity');
1102+
this.setAttr(element.domElement(), 'fill-opacity', goog.isDef(fill['opacity']) ? fill['opacity'] : 1);
10971103
} else if (fill['src']) {
10981104
var b = element.getBoundsWithoutTransform();
10991105
if (b) {
@@ -1132,11 +1138,6 @@ acgraph.vector.svg.Renderer.prototype.applyFill = function(element) {
11321138
pattern.parent(element.getStage()).render();
11331139
this.setAttr(element.domElement(), 'fill', pathPrefix + pattern.id() + ')');
11341140
} else {
1135-
// DVF-1729 fix
1136-
// because internet explorer converts fill-opacity "0.00001" to "1e-5" that is not css-compatible
1137-
// and export server can't generate proper image.
1138-
if (fill['opacity'] <= 0.0001 && goog.userAgent.IE && goog.userAgent.isVersionOrHigher('9'))
1139-
fill['opacity'] = 0.0001;
11401141
this.setAttrs(element.domElement(), {
11411142
'fill': (/** @type {acgraph.vector.SolidFill} */(fill))['color'],
11421143
'fill-opacity': (/** @type {acgraph.vector.SolidFill} */(fill))['opacity']

0 commit comments

Comments
 (0)