mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-29 17:44:42 +00:00
Fix parsing of gradients with stops that have absolute values (rather than percents).
This commit is contained in:
parent
c057b8b6d5
commit
4565e0dd6a
6 changed files with 13 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/*! Fabric.js Copyright 2008-2012, Bitsonnet (Juriy Zaytsev, Maxim Chernyak) */
|
||||
|
||||
var fabric = fabric || { version: "0.7.12" };
|
||||
var fabric = fabric || { version: "0.7.13" };
|
||||
|
||||
if (typeof exports != 'undefined') {
|
||||
exports.fabric = fabric;
|
||||
|
|
|
|||
7
dist/all.js
vendored
7
dist/all.js
vendored
|
|
@ -1,6 +1,6 @@
|
|||
/*! Fabric.js Copyright 2008-2012, Bitsonnet (Juriy Zaytsev, Maxim Chernyak) */
|
||||
|
||||
var fabric = fabric || { version: "0.7.12" };
|
||||
var fabric = fabric || { version: "0.7.13" };
|
||||
|
||||
if (typeof exports != 'undefined') {
|
||||
exports.fabric = fabric;
|
||||
|
|
@ -3693,7 +3693,10 @@ fabric.util.string = {
|
|||
|
||||
for (var i = colorStopEls.length; i--; ) {
|
||||
el = colorStopEls[i];
|
||||
offset = parseInt(el.getAttribute('offset'), 10) / 100;
|
||||
offset = el.getAttribute('offset');
|
||||
|
||||
// convert percents to absolute values
|
||||
offset = parseFloat(offset) / (/%$/.test(offset) ? 100 : 1);
|
||||
colorStops[offset] = getColorStopFromStyle(el) || el.getAttribute('stop-color');
|
||||
}
|
||||
|
||||
|
|
|
|||
4
dist/all.min.js
vendored
4
dist/all.min.js
vendored
File diff suppressed because one or more lines are too long
BIN
dist/all.min.js.gz
vendored
BIN
dist/all.min.js.gz
vendored
Binary file not shown.
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "fabric",
|
||||
"description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.",
|
||||
"version": "0.7.12",
|
||||
"version": "0.7.13",
|
||||
"author": "Juriy Zaytsev <kangax@gmail.com>",
|
||||
"keywords": ["canvas", "graphic", "graphics", "SVG", "node-canvas", "parser", "HTML5", "object model"],
|
||||
"repository": "git://github.com/kangax/fabric.js",
|
||||
|
|
|
|||
|
|
@ -83,7 +83,10 @@
|
|||
|
||||
for (var i = colorStopEls.length; i--; ) {
|
||||
el = colorStopEls[i];
|
||||
offset = parseInt(el.getAttribute('offset'), 10) / 100;
|
||||
offset = el.getAttribute('offset');
|
||||
|
||||
// convert percents to absolute values
|
||||
offset = parseFloat(offset) / (/%$/.test(offset) ? 100 : 1);
|
||||
colorStops[offset] = getColorStopFromStyle(el) || el.getAttribute('stop-color');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue