Skip to content

Commit

Permalink
🐛 fix feColorMatrix whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
noeldelgado committed Mar 1, 2020
1 parent b41ff05 commit 185a02e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<button class="cc-btn" data-js-copy-to-clipboard-btn data-copy="value:[data-js-fecolormatrix-input]" disabled>
<svg width="16" height="16"><use xlink:href="#svg-file_copy-outlined-24px"></use></svg>
<span>feColorMatrix’s values</span>
<textarea data-js-fecolormatrix-input rows="10" cols="80" style="display: none;"></textarea>
<textarea data-js-fecolormatrix-input rows="4" readonly style="display: none;"></textarea>
</button>
</div>
</main>
Expand Down
8 changes: 4 additions & 4 deletions src/js/lib/components/fe-color-matrix-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class FeColorMatrixInput {
* @return {this}
*/
setValue([r, g, b, a = 1]) {
this.config.el.value = this._getColorMatrixValue(r, g, b, a);
this.config.el.value = this._getColorMatrixValue(r, g, b, a).replace(/$\s+/gm, '\n');
return this;
}

Expand All @@ -50,8 +50,8 @@ export default class FeColorMatrixInput {
*/
_getColorMatrixValue(...channels) {
return `${internals.formatDecimals(channels[0])}\t0\t0\t0\t0
\n0\t${internals.formatDecimals(channels[1])}\t0\t0\t0
\n0\t0\t${internals.formatDecimals(channels[2])}\t0\t0
\n0\t0\t0\t${internals.formatDecimals(channels[3])}\t0`;
0\t${internals.formatDecimals(channels[1])}\t0\t0\t0
0\t0\t${internals.formatDecimals(channels[2])}\t0\t0
0\t0\t0\t${internals.formatDecimals(channels[3])}\t0`;
}
}

0 comments on commit 185a02e

Please sign in to comment.