deweese 2003/12/05 10:32:38
Modified: sources/org/apache/batik/bridge BridgeEventSupport.java
SVGPatternElementBridge.java
sources/org/apache/batik/css/engine CSSEngine.java
sources/org/apache/batik/ext/awt/image/rendered
Any2sRGBRed.java
sources/org/apache/batik/util
ParsedURLDefaultProtocolHandler.java
Log:
1) Extra check on null element bounds in event handling.
2) Small optimization for attribute changes in CSSEngine.
3) Pattern element no longer applies object bounding box
transform if viewBox is specified (per spec).
Revision Changes Path
1.52 +5 -2
xml-batik/sources/org/apache/batik/bridge/BridgeEventSupport.java
Index: BridgeEventSupport.java
===================================================================
RCS file:
/home/cvs/xml-batik/sources/org/apache/batik/bridge/BridgeEventSupport.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- BridgeEventSupport.java 22 Aug 2003 10:49:06 -0000 1.51
+++ BridgeEventSupport.java 5 Dec 2003 18:32:37 -0000 1.52
@@ -54,6 +54,7 @@
import java.awt.event.KeyEvent;
import java.awt.geom.NoninvertibleTransformException;
import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
import java.text.AttributedCharacterIterator;
import java.util.List;
@@ -437,7 +438,9 @@
float x = (float)pt.getX();
float y = (float)pt.getY();
TextHit textHit = layout.hitTestChar(x, y);
- if (textHit != null && layout.getBounds2D().contains(x, y))
{
+ Rectangle2D bounds = layout.getBounds2D();
+ if ((textHit != null) &&
+ (bounds != null) && bounds.contains(x, y)) {
Object delimiter = aci.getAttribute
(GVTAttributedCharacterIterator.TextAttribute.TEXT_COMPOUND_DELIMITER);
if (delimiter instanceof Element) {
1.25 +21 -20
xml-batik/sources/org/apache/batik/bridge/SVGPatternElementBridge.java
Index: SVGPatternElementBridge.java
===================================================================
RCS file:
/home/cvs/xml-batik/sources/org/apache/batik/bridge/SVGPatternElementBridge.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- SVGPatternElementBridge.java 8 Aug 2003 11:38:51 -0000 1.24
+++ SVGPatternElementBridge.java 5 Dec 2003 18:32:37 -0000 1.25
@@ -197,25 +197,26 @@
(patternElement, viewBoxStr, aspectRatioStr, w, h);
patternContentTransform.concatenate(preserveAspectRatioTransform);
- }
+ } else {
+ //
+ // Process patternContentUnitsTransform
+ //
+ if (contentCoordSystem == SVGUtilities.OBJECT_BOUNDING_BOX){
+ AffineTransform patternContentUnitsTransform
+ = new AffineTransform();
+ Rectangle2D objectBoundingBox =
+ paintedNode.getGeometryBounds();
+ patternContentUnitsTransform.translate
+ (objectBoundingBox.getX(),
+ objectBoundingBox.getY());
- //
- // Process patternContentUnitsTransform
- //
- if(contentCoordSystem == SVGUtilities.OBJECT_BOUNDING_BOX){
- AffineTransform patternContentUnitsTransform
- = new AffineTransform();
- Rectangle2D objectBoundingBox = paintedNode.getGeometryBounds();
- patternContentUnitsTransform.translate
- (objectBoundingBox.getX(),
- objectBoundingBox.getY());
+ patternContentUnitsTransform.scale
+ (objectBoundingBox.getWidth(),
+ objectBoundingBox.getHeight());
- patternContentUnitsTransform.scale
- (objectBoundingBox.getWidth(),
- objectBoundingBox.getHeight());
-
- patternContentTransform.concatenate
- (patternContentUnitsTransform);
+ patternContentTransform.concatenate
+ (patternContentUnitsTransform);
+ }
}
//
1.36 +4 -1 xml-batik/sources/org/apache/batik/css/engine/CSSEngine.java
Index: CSSEngine.java
===================================================================
RCS file: /home/cvs/xml-batik/sources/org/apache/batik/css/engine/CSSEngine.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- CSSEngine.java 31 Oct 2003 22:39:41 -0000 1.35
+++ CSSEngine.java 5 Dec 2003 18:32:37 -0000 1.36
@@ -2313,6 +2313,9 @@
}
MutationEvent mevt = (MutationEvent)evt;
+ if (mevt.getNewValue().equals(mevt.getPrevValue()))
+ return; // no change really...
+
Node attr = mevt.getRelatedNode();
String attrNS = attr.getNamespaceURI();
String name = (attrNS == null)
1.8 +3 -2
xml-batik/sources/org/apache/batik/ext/awt/image/rendered/Any2sRGBRed.java
Index: Any2sRGBRed.java
===================================================================
RCS file:
/home/cvs/xml-batik/sources/org/apache/batik/ext/awt/image/rendered/Any2sRGBRed.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Any2sRGBRed.java 9 Aug 2003 16:58:42 -0000 1.7
+++ Any2sRGBRed.java 5 Dec 2003 18:32:37 -0000 1.8
@@ -238,7 +238,8 @@
op.filter(srcRas, wr);
} else {
ColorModel dstCM = getColorModel();
- if (srcCM.getColorSpace() == dstCM.getColorSpace()) {
+ if ((srcCM.getColorSpace() == dstCM.getColorSpace()) &&
+ srcCM.isCompatibleRaster(wr)) {
// No transform needed, just reformat data...
// System.out.println("Bypassing");
1.15 +2 -1
xml-batik/sources/org/apache/batik/util/ParsedURLDefaultProtocolHandler.java
Index: ParsedURLDefaultProtocolHandler.java
===================================================================
RCS file:
/home/cvs/xml-batik/sources/org/apache/batik/util/ParsedURLDefaultProtocolHandler.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ParsedURLDefaultProtocolHandler.java 8 Aug 2003 11:39:26 -0000 1.14
+++ ParsedURLDefaultProtocolHandler.java 5 Dec 2003 18:32:38 -0000 1.15
@@ -111,6 +111,7 @@
return constructParsedURLData(url);
} catch (MalformedURLException mue) {
// Built in URL wouldn't take it...
+ // mue.printStackTrace();
}
// new Exception("Custom Parse: " + urlStr).printStackTrace();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]