Permalink
Browse files

changed defaulting code to check strictly for undefined. fixes bug wh…

…ere stroke-width of 0 cannot be specified
  • Loading branch information...
1 parent d686a9b commit 8f5c926176b4c619508a5ac5e32ff0616c6d0a3e @dnewcome committed Feb 17, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 donatello.js
View
@@ -317,7 +317,8 @@ Donatello.createElement = function( x, y, w, h, name ) {
*/
Donatello.attrDefaults = function( a ) {
a = a || {};
- if( !a['stroke-width'] ) a['stroke-width'] = 1;
+ // have to strictly check for undefined to avoid case where width = 0
+ if( a['stroke-width'] === undefined ) a['stroke-width'] = 1;
if( !a['stroke'] ) a['stroke'] = 'black';
if( !a['fill'] ) a['fill'] = 'transparent';
if( !a['stroke-style'] ) a['stroke-style'] = 'solid';

0 comments on commit 8f5c926

Please sign in to comment.