Hello,
there was an error in the parsing code for color filters, it should work
after the attached patch is applied. And your decision to send in the
file is right, because nobody can fix a bug that isn't known.

More technical stuff:
The end-condition for reading the ColorMatrix was wrong, so 21 instead
of 20 floats were read and that screwed up everything after the matrix.
I decided to add a size attribute to the list tag to make the source.xml
file look less confusing. size==19 for an list with 20 elements doesn't
look right ;). The Convolution filter also uses such a matrix and had a
similar end-condition, so i changed this attribute to an size attribute.
I couldn't check if this works because i don't have flash or an swf file
that contains this filter, but i think so.

Ralf

> Thanks!  I tried out 0.2.12.4 and it works for many of my buttons, but
> I found one which it doesn't like.  I've attached a sample swf and
> fla, and the output from the parsing.  The difference is that this
> button has an adjust color filter on it.  
> 
> I can probably work around this, but I thought I'd send it along.
> Maybe it's another quick fix.
> 
> Thanks again.
> 
> --Brian
Index: src/codegen/source.xml
===================================================================
--- src/codegen/source.xml	(revision 216)
+++ src/codegen/source.xml	(working copy)
@@ -541,7 +541,7 @@
 	<byte name="matrixY" prop="true"/>
 	<float name="divizor" prop="true"/>
 	<float name="bias" prop="true"/>
-	<list type="Float" name="matrix" prop="true" end-condition="matrix.size() == matrixX * matrixY"/>
+	<list type="Float" name="matrix" prop="true" size="matrixX * matrixY"/>
 	<object type="Color" name="defaultColor" prop="true"/>
 	<integer name="reserved" size="5" constant-size="true"/>
 	<bit name="clamp" prop="true"/>
@@ -549,7 +549,7 @@
 </filter>
 
 <filter name="ColorMatrix" id="0x06">
-	<list type="Float" name="matrix" prop="true" end-condition="(matrix.size()==20)"/>
+	<list type="Float" name="matrix" prop="true" size="20"/>
 </filter>
 
 <filter name="GradientBevel" id="0x07">
Index: src/codegen/parser.xsl
===================================================================
--- src/codegen/parser.xsl	(revision 216)
+++ src/codegen/parser.xsl	(working copy)
@@ -149,6 +149,12 @@
 						item = NULL;
 					}
 				</xsl:if>
+				<xsl:if test="@size">
+					if(item &amp;&amp; (<xsl:value-of select="@name"/>.size() == <xsl:value-of select="@size"/> - 1)) {
+						<xsl:value-of select="@name"/>.append( item );
+						item = NULL;
+					}
+				</xsl:if>
 			}
 		}
 	}
_______________________________________________
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org

Reply via email to