Skip to content

Commit

Permalink
Version 0.1.14.
Browse files Browse the repository at this point in the history
  • Loading branch information
fdb committed May 25, 2018
1 parent 3bd5e85 commit 0ac568a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
14 changes: 9 additions & 5 deletions dist/g.js
Original file line number Diff line number Diff line change
Expand Up @@ -23000,8 +23000,8 @@ Color.prototype.toCSS = function () {
return Color.toCSS(this);
};

Color.prototype.toHex = function () {
if (this.a >= 1) {
Color.prototype.toHex = function (ignoreAlpha) {
if (ignoreAlpha || this.a >= 1) {
return color.rgb2hex(this.r, this.g, this.b);
} else {
return color.rgba2hex(this.r, this.g, this.b, this.a);
Expand Down Expand Up @@ -23060,8 +23060,8 @@ Color.toCSS = function (c) {
}
};

Color.toHex = function (c) {
return Color.parse(c).toHex();
Color.toHex = function (c, ignoreAlpha) {
return Color.parse(c, ignoreAlpha).toHex();
};

Color.make = function () {
Expand Down Expand Up @@ -24446,7 +24446,11 @@ GText.prototype.toSVG = function () {
}
svg += ' text-anchor="' + textAnchor + '"';
if (this.fill !== 'black') {
svg += ' fill="' + Color.toCSS(this.fill) + '"';
var fill = Color.parse(this.fill);
svg += ' fill="' + fill.toHex(true) + '"';
if (fill.a < 1) {
svg += ' opacity="' + fill.a + '"';
}
}
if (!this.transform.isIdentity()) {
svg += ' transform="matrix(' + this.transform.m.join(',') + ')"';
Expand Down
Loading

0 comments on commit 0ac568a

Please sign in to comment.