From dda68b44dd76766b84e190192e565d31a509a5bd Mon Sep 17 00:00:00 2001 From: Chris Buergi Date: Mon, 30 Jun 2014 16:19:35 +0200 Subject: [PATCH] Render IText correctly when only fontWeight or fontStyle changes Fixes rendering of characters that only have the styles "fontWeight" and/or "fontStyle" set. Previously _hasStyleChanged() did not detect a change if only one of those two styles have been set. --- src/shapes/itext.class.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shapes/itext.class.js b/src/shapes/itext.class.js index ca66b3ec..53d1b066 100644 --- a/src/shapes/itext.class.js +++ b/src/shapes/itext.class.js @@ -356,6 +356,8 @@ textBackgroundColor: style && style.textBackgroundColor || this.textBackgroundColor, textDecoration: style && style.textDecoration || this.textDecoration, fontFamily: style && style.fontFamily || this.fontFamily, + fontWeight: style && style.fontWeight || this.fontWeight, + fontStyle: style && style.fontStyle || this.fontStyle, stroke: style && style.stroke || this.stroke, strokeWidth: style && style.strokeWidth || this.strokeWidth }; @@ -695,6 +697,8 @@ prevStyle.textBackgroundColor !== thisStyle.textBackgroundColor || prevStyle.textDecoration !== thisStyle.textDecoration || prevStyle.fontFamily !== thisStyle.fontFamily || + prevStyle.fontWeight !== thisStyle.fontWeight || + prevStyle.fontStyle !== thisStyle.fontStyle || prevStyle.stroke !== thisStyle.stroke || prevStyle.strokeWidth !== thisStyle.strokeWidth );