fix dynamically applied NodeUI state classes to invalidate style list when changed
authorRichard Fairhurst <richard@systemed.net>
Fri, 12 Nov 2010 10:52:15 +0000 (10:52 +0000)
committerRichard Fairhurst <richard@systemed.net>
Fri, 12 Nov 2010 10:52:15 +0000 (10:52 +0000)
net/systemeD/halcyon/EntityUI.as
net/systemeD/halcyon/NodeUI.as

index 88757e3..11cb0a7 100644 (file)
@@ -169,6 +169,7 @@ package net.systemeD.halcyon {
         }
 
         public function setStateClass(stateType:String, isOn:*):Boolean {
+                       if ( isOn == true ) { isOn='yes'; }
             if ( isOn && stateClasses[stateType] != isOn ) {
                 stateClasses[stateType] = isOn;
                                invalidateStyleList();
index 4ad5bd9..07477bc 100644 (file)
@@ -54,10 +54,10 @@ package net.systemeD.halcyon {
                        if (entity.deleted) { return false; }
 
                        var tags:Object = entity.getTagsCopy();
+                       setStateClass('poi', !entity.hasParentWays);
+            setStateClass('hasTags', entity.hasInterestingTags());
+            setStateClass('dupe', Node(entity).isDupe());
                        tags=applyStateClasses(tags);
-                       if (!entity.hasParentWays) { tags[':poi']='yes'; }
-            if (entity.hasInterestingTags()) { tags[':hasTags']='yes'; }
-            if (Node(entity).isDupe()) { tags[':dupe']='yes'; }
                        if (!styleList || !styleList.isValidAt(paint.map.scale)) {
                                styleList=paint.ruleset.getStyles(entity,tags,paint.map.scale); 
                        }