Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rhclark opened this issue Aug 6, 2015 · 0 comments
Open

Comments

@rhclark
Copy link

rhclark commented Aug 6, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant