
| Key: |
FVG-136
|
| Type: |
Bug
|
| Status: |
Resolved
|
| Resolution: |
Fixed
|
| Priority: |
Major
|
| Assignee: |
Mark Donszelmann
|
| Reporter: |
Anonymous
|
| Votes: |
0
|
| Watchers: |
0
|
|
|
|
|
| Component/s: |
GraphicsIO
|
| Affects Version/s: |
1.2.2
|
| Fix Version/s: |
2.0
|
|
|
Issue Links:
|
See also
|
|
|
|
This issue is related to:
|
|
|
FVG-9 Clipping improvements for most drivers
|
|
|
|
|
|
|
|
In release 1.2.2 of org.freehep.graphicsio.AbstractVectorGraphicsIO.java, the method setTransform(AffineTransform) is behaving in a "pass by reference" manner. Although it is not clearly documented in the java API specs, java.awt.Graphics2D implementations all treat this method as "pass by value". Therefore, to be truly compatible with other Graphics2D implementations, you should not store a reference to the AffineTransform being passed into this method; instead, make a copy of it into a private (or new) AffineTransform. The patch I'm submitting is instantiating a new AffineTransform; the patch fixes the problem with the least amount of code change (one line). However, my fix is not the most efficient because it requires one instantiation of AffineTransform per call to setTransform(), which is not the most efficient solution possible.
I'm using a patched version of AbstractVectorGraphicsIO.java to work around this bug. This problem still exists in today's CVS snapshot. Here is the patch:
--- org/freehep/graphicsio/AbstractVectorGraphicsIO.java-orig 2005-08-23 20:45:17.274831904 -0700
+++ org/freehep/graphicsio/AbstractVectorGraphicsIO.java 2005-08-23 20:46:45.842367592 -0700
@@ -579,7 +579,7 @@
} catch (IOException e) {
handleException(e);
}
- currentTransform = transform;
+ currentTransform = new AffineTransform(transform);
}
/**
|
|
Description
|
In release 1.2.2 of org.freehep.graphicsio.AbstractVectorGraphicsIO.java, the method setTransform(AffineTransform) is behaving in a "pass by reference" manner. Although it is not clearly documented in the java API specs, java.awt.Graphics2D implementations all treat this method as "pass by value". Therefore, to be truly compatible with other Graphics2D implementations, you should not store a reference to the AffineTransform being passed into this method; instead, make a copy of it into a private (or new) AffineTransform. The patch I'm submitting is instantiating a new AffineTransform; the patch fixes the problem with the least amount of code change (one line). However, my fix is not the most efficient because it requires one instantiation of AffineTransform per call to setTransform(), which is not the most efficient solution possible.
I'm using a patched version of AbstractVectorGraphicsIO.java to work around this bug. This problem still exists in today's CVS snapshot. Here is the patch:
--- org/freehep/graphicsio/AbstractVectorGraphicsIO.java-orig 2005-08-23 20:45:17.274831904 -0700
+++ org/freehep/graphicsio/AbstractVectorGraphicsIO.java 2005-08-23 20:46:45.842367592 -0700
@@ -579,7 +579,7 @@
} catch (IOException e) {
handleException(e);
}
- currentTransform = transform;
+ currentTransform = new AffineTransform(transform);
}
/**
|
Show » |
| There are no comments yet on this issue.
|
|