From 6caf60670b51564b0a6a4e51c3f7163fd7f1c145 Mon Sep 17 00:00:00 2001 From: Stefan Kienzle Date: Tue, 30 Apr 2013 16:27:01 +0300 Subject: [PATCH] Fixed _renderFill - fallback for offsetX/offsetY If object.fill.offsetX or object.fill.offsetY is undefined (e.g. fill = fabric.Gradient) browser might have problems (seen in firefox 3.6.28). --- src/object.class.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/object.class.js b/src/object.class.js index 7fa4ed93..19e1d689 100644 --- a/src/object.class.js +++ b/src/object.class.js @@ -663,8 +663,8 @@ if (this.fill.toLive) { ctx.save(); ctx.translate( - -this.width / 2 + this.fill.offsetX, - -this.height / 2 + this.fill.offsetY); + -this.width / 2 + this.fill.offsetX || 0, + -this.height / 2 + this.fill.offsetY || 0); } ctx.fill(); if (this.fill.toLive) {