Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#823 VectorRenderer + PlotOrientation.Horizontal = not working

1.0.x
closed-fixed
David Gilbert
General (896)
5
2008-02-18
2008-01-26
Anonymous
No

VectorRenderer does not properly draw the head of the arrow when the PlotOrientation is set to horizontal. It draws it as if it were vertical.

The fix is very simple:

In VectorRender.drawItem():

Replace

GeneralPath p = new GeneralPath();
p.moveTo((float) xx1, (float) yy1);
p.lineTo((float) rightx, (float) righty);
p.lineTo((float) bx, (float) by);
p.lineTo((float) leftx, (float) lefty);
p.closePath();
g2.draw(p);

with

GeneralPath p = new GeneralPath();

if (orientation.equals(PlotOrientation.HORIZONTAL))
p.moveTo((float) yy1, (float) xx1);
p.lineTo((float) righty, (float) rightx);
p.lineTo((float) by, (float) bx);
p.lineTo((float) lefty, (float) leftx);
} else {
p.moveTo((float) xx1, (float) yy1);
p.lineTo((float) rightx, (float) righty);
p.lineTo((float) bx, (float) by);
p.lineTo((float) leftx, (float) lefty);
}

p.closePath();
g2.draw(p);

Very simple, just mimicked what was being done when the line was being drawn.

Discussion

  • David Gilbert
    David Gilbert
    2008-02-18

    Logged In: YES
    user_id=112975
    Originator: NO

    Thanks for the report. I've committed the fix to Subversion for inclusion in the 1.0.10 release.

    Regards,

    Dave Gilbert
    JFreeChart Project Leader

     
  • David Gilbert
    David Gilbert
    2008-02-18

    • milestone: --> 1.0.x
    • assigned_to: nobody --> mungady
    • status: open --> closed-fixed