depth incremented wrong

Bug #1244296 reported by Brent S Elmer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SquareMap
Fix Released
Medium
Mike C. Fletcher

Bug Description

When I try to use the squaremap code and use the shallower and deeper features such as in runsnake, I found that shallower was not working correctly. What is happening is that depth is incremented essentially twice as often as it should be. This makes max_depth_seen double. I have found that the problem is in LayoutChildren where DrawBox is called. depth is being incremented on the call to DrawBox when it has already been incremented on the call to LayoutChildren.

            if head_coord:
                self.DrawBox(
                    dc, firstNode, head_coord[0],head_coord[1],head_coord[2],head_coord[3],
                    hot_map, depth+1
                )

should be:

            if head_coord:
                self.DrawBox(
                    dc, firstNode, head_coord[0],head_coord[1],head_coord[2],head_coord[3],
                    hot_map, depth
                )

When I make that simple change, max_depth_seen is correct and shallower works fine.

Revision history for this message
Mike C. Fletcher (mcfletch) wrote :

Thanks for letting me know. Fix is released on PyPI.

Changed in squaremap:
assignee: nobody → Mike C. Fletcher (mcfletch)
importance: Undecided → Medium
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.