Permalink
Browse files

Fix broken style-merging behaviour

  • Loading branch information...
1 parent 749f2c8 commit 4e72cd67a534fbdff55d941c421531d8f2776b88 @systemed committed Mar 7, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 net/systemeD/halcyon/styleparser/ShapeStyle.as
  2. +1 −1 net/systemeD/halcyon/styleparser/Style.as
@@ -4,7 +4,7 @@ package net.systemeD.halcyon.styleparser {
public class ShapeStyle extends Style {
- public var width:Number=0;
+ public var width:Number;
public var color:Number;
public var opacity:Number;
public var dashes:Array=[];
@@ -32,7 +32,7 @@ package net.systemeD.halcyon.styleparser {
}
override public function get drawn():Boolean {
- return (fill_image || !isNaN(fill_color) || width || casing_width);
+ return (fill_image || !isNaN(fill_color) || !isNaN(width) || casing_width);
}
public function applyStrokeStyle(g:Graphics):void {
@@ -56,7 +56,7 @@ package net.systemeD.halcyon.styleparser {
public function mergeWith(additional:Style):void {
for each (var prop:String in properties) {
// Note extra check for empty arrays, which we use to mean 'undefined' (see setPropertyFromString below)
- if (additional[prop] != undefined && !((additional[prop] is Array) && additional[prop].length==0)) {
+ if (additional[prop]!=undefined && !((additional[prop] is Number) && isNaN(additional[prop])) && !((additional[prop] is Array) && additional[prop].length==0)) {
this[prop]=additional[prop];
}
}

0 comments on commit 4e72cd6

Please sign in to comment.