History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: FVG-211
Type: Bug Bug
Status: Resolved Resolved
Resolution: Won't Fix
Priority: Minor Minor
Assignee: Mark Donszelmann
Reporter: Mark Donszelmann
Votes: 0
Watchers: 0
Operations

Clone this issue
Create sub-task
If you were logged in you would be able to see more operations.
FreeHEP Vector Graphics

ArrayIndexOutOfBoundsException for CubicCurve

Created: 10/May/06 04:49 PM   Updated: 13/Nov/06 10:53 PM
Component/s: EMF
Affects Version/s: 1.2.2
Fix Version/s: 2.0

Reported By: rmolnar@woh.rr.com


 Description  « Hide
 Found a bug in the EMF output. And the fix is here.

java.lang.ArrayIndexOutOfBoundsException: 4
       at org.freehep.graphicsio.emf.EMFGraphics2D.draw(EMFGraphics2D.java:323)

Source Code:

if (shape instanceof CubicCurve2D) {
               CubicCurve2D curve = (CubicCurve2D)shape;
               writePen((BasicStroke)getStroke(), getColor());
               points[0].x = toUnit(curve.getX1());
               points[0].y = toUnit(curve.getY1());
               points[1].x = toUnit(curve.getCtrlX1());
               points[1].y = toUnit(curve.getCtrlY1());
               points[2].x = toUnit(curve.getCtrlX2());
               points[2].y = toUnit(curve.getCtrlY2());
               points[3].x = toUnit(curve.getX2());
               points[4].y = toUnit(curve.getY2()); <----- Needs to be changed to 3 not 4.
               os.writeTag(new PolyBezier(imageBounds, 4, points)); return;
           }



 All   Comments   Change History      Sort Order:
Mark Donszelmann - 13/Nov/06 10:53 PM
This code is now handled generically, so fix is no longer applicable.