tkormann 02/05/14 00:34:39
Modified: sources/org/apache/batik/bridge
SVGFeColorMatrixElementBridge.java
Log:
- fix a bug for the default attribute value of 'values' if type is
'hueRotate' or 'saturate'
- fix a bug for the 'matrix' type, where the default value of the
attribute 'values' is the identity matrix (instead of going into
error).
Revision Changes Path
1.12 +9 -6
xml-batik/sources/org/apache/batik/bridge/SVGFeColorMatrixElementBridge.java
Index: SVGFeColorMatrixElementBridge.java
===================================================================
RCS file:
/home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGFeColorMatrixElementBridge.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- SVGFeColorMatrixElementBridge.java 19 Mar 2002 15:19:25 -0000 1.11
+++ SVGFeColorMatrixElementBridge.java 14 May 2002 07:34:39 -0000 1.12
@@ -26,7 +26,7 @@
* Bridge class for the <feColorMatrix> element.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Thierry Kormann</a>
- * @version $Id: SVGFeColorMatrixElementBridge.java,v 1.11 2002/03/19 15:19:25
deweese Exp $
+ * @version $Id: SVGFeColorMatrixElementBridge.java,v 1.12 2002/05/14 07:34:39
tkormann Exp $
*/
public class SVGFeColorMatrixElementBridge
extends AbstractSVGFilterPrimitiveElementBridge {
@@ -135,12 +135,15 @@
*/
protected static float[][] convertValuesToMatrix(Element filterElement) {
String s = filterElement.getAttributeNS(null, SVG_VALUES_ATTRIBUTE);
+ float [][] matrix = new float[4][5];
if (s.length() == 0) {
- throw new BridgeException(filterElement, ERR_ATTRIBUTE_MISSING,
- new Object[] {SVG_VALUES_ATTRIBUTE});
+ matrix[0][0] = 1;
+ matrix[1][1] = 1;
+ matrix[2][2] = 1;
+ matrix[3][3] = 1;
+ return matrix;
}
StringTokenizer tokens = new StringTokenizer(s, " ,");
- float [][] matrix = new float[4][5];
int n = 0;
try {
while (n < 20 && tokens.hasMoreTokens()) {
@@ -175,7 +178,7 @@
String s = filterElement.getAttributeNS(null, SVG_VALUES_ATTRIBUTE);
int length = s.length();
if (s.length() == 0) {
- return 0; // default is 0
+ return 1; // default is 1
} else {
try {
return SVGUtilities.convertSVGNumber(s);
@@ -197,7 +200,7 @@
String s = filterElement.getAttributeNS(null, SVG_VALUES_ATTRIBUTE);
int length = s.length();
if (s.length() == 0) {
- return 1; // default is 1
+ return 0; // default is 0
} else {
try {
return (float)(SVGUtilities.convertSVGNumber(s)*Math.PI)/180f;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]