diff --git a/src/pattern.class.js b/src/pattern.class.js
index 8467bc8c..11c19323 100644
--- a/src/pattern.class.js
+++ b/src/pattern.class.js
@@ -109,10 +109,10 @@
*/
toSVG: function(object) {
var patternSource = typeof this.source === 'function' ? this.source() : this.source,
- patternWidth = patternSource.width / object.getWidth(),
- patternHeight = patternSource.height / object.getHeight(),
- patternOffsetX = this.offsetX / object.getWidth(),
- patternOffsetY = this.offsetY / object.getHeight(),
+ patternWidth = patternSource.width / object.width,
+ patternHeight = patternSource.height / object.height,
+ patternOffsetX = this.offsetX / object.width,
+ patternOffsetY = this.offsetY / object.height,
patternImgSrc = '';
if (this.repeat === 'repeat-x' || this.repeat === 'no-repeat') {
patternHeight = 1;
diff --git a/src/static_canvas.class.js b/src/static_canvas.class.js
index 57b1e5c8..7969ee41 100644
--- a/src/static_canvas.class.js
+++ b/src/static_canvas.class.js
@@ -1204,9 +1204,6 @@
'version="1.1" ',
'width="', width, '" ',
'height="', height, '" ',
- (this.backgroundColor && !this.backgroundColor.toLive
- ? 'style="background-color: ' + this.backgroundColor + '" '
- : null),
viewBox,
'xml:space="preserve">\n',
'Created with Fabric.js ', fabric.version, '\n',
@@ -1324,22 +1321,28 @@
* @private
*/
_setSVGBgOverlayColor: function(markup, property) {
- if (this[property] && this[property].source) {
+ var filler = this[property];
+ if (!filler) {
+ return;
+ }
+ if (filler.toLive) {
+ var repeat = filler.repeat;
markup.push(
- '\n'
);
}
- else if (this[property] && property === 'overlayColor') {
+ else {
markup.push(
'