Merge remote-tracking branch 'systemed/filebank' into filebank
[potlatch2.git] / net / systemeD / halcyon / styleparser / StyleChooser.as
index 9ae6343839f7b72ccc5d6b24b9bc0f2c7d8094b2..f0e95bc50745152858eabec3721315a1b5927622 100644 (file)
@@ -52,7 +52,8 @@ package net.systemeD.halcyon.styleparser {
                                        sl.addSubpart(c.subpart);
 
                                        // Update StyleList
-                                       for each (var r:Style in styles) {
+                                       for (var i:uint=0; i<styles.length; i++) {
+                                               var r:Style=styles[i];
                                                var a:Object;
                                                if (r is ShapeStyle) {
                                                        a=sl.shapeStyles;
@@ -73,9 +74,7 @@ package net.systemeD.halcyon.styleparser {
                                                        if (w>sl.maxwidth) { sl.maxwidth=w; }
                                                } else if (r is InstructionStyle) {
                                                        if (InstructionStyle(r).breaker) { return; }
-                                                       if (InstructionStyle(r).set_tags) {
-                                                               for (var k:String in InstructionStyle(r).set_tags) { tags[k]=InstructionStyle(r).set_tags[k]; }
-                                                       }
+                                                       InstructionStyle(r).assignSetTags(tags);
                                                        continue;
                                                }
                                                if (r.drawn) { tags[':drawn']='yes'; }
@@ -96,6 +95,24 @@ package net.systemeD.halcyon.styleparser {
                        }
                }
                
+               /** Cut-down version of updateStyles that runs InstructionStyles only - for CSSTransform usage. */
+
+               public function runInstructions(obj:Entity, tags:Object):Object {
+                       for each (var c:RuleChain in ruleChains) {
+                               if (c.test(-1,obj,tags,10)) {
+                                       for (var i:uint=0; i<styles.length; i++) {
+                                               var r:Style=styles[i];
+                                               if (r is InstructionStyle) {
+                                                       if (InstructionStyle(r).breaker) { return tags; }
+                                                       InstructionStyle(r).assignSetTags(tags);
+                                               }
+                                               r.runEvals(tags);
+                                       }
+                               }
+                       }
+                       return tags;
+               }
+               
                
                // ---------------------------------------------------------------------------------------------
                // Methods to add properties (used by parsers such as MapCSS)