Skip to content

Side effects in the setBounds() method of the EdgeRenderer.java class #26

@rhclark

Description

@rhclark

Concerning the last little block of code in the setBounds(VisualItem item) method in the EdgeRenderer.java class, I added one print statement in the middle that checks to see if m_curArrow is null. Here's my version:

if ( m_curArrow != null ) {
Rectangle2D bbox = (Rectangle2D)item.get(VisualItem.BOUNDS);
if ( m_curArrow == null )
{ System.out.println(“ But now m_curArrow is null.”); }
Rectangle2D.union(bbox, m_curArrow.getBounds2D(), bbox);
}

It seems impossible, but I have some data sets that cause the print statement to get executed. My best guess is that the VisualItem.BOUNDS constant is no longer maintained, and passing Visual.BOUNDS to get() is causing some strange side efects.

I would have proposed a fix to this problem, but to be honest, I don't quite understand what this block is supposed to do. It declares bbox, updates it, and then seems to do nothing with it.

For my own purposes, I've simply added a check to see if m_curArrow is null in my own copy of the code. But I thought that I should open a GitHub issue so that the defect does not get forgotten.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions