Permalink
Browse files

Fixed a copy-paste typo which caused MaxRects bin packer to compute t…

…he scoring heuristic wrong for non-upright rectangle positions when using the ContactPoint heuristic. This will likely improve the MaxRects-CP heuristic from what was presented in the survey.

Thanks to Pavel Ahafonau for reporting this.
  • Loading branch information...
juj committed Jan 8, 2012
1 parent 0a4fd0c commit 887ffb4f144a7c84f0d96bbdccf483608ba72d6e
Showing with 1 addition and 1 deletion.
  1. +1 −1 MaxRectsBinPack.cpp
View
@@ -406,7 +406,7 @@ Rect MaxRectsBinPack::FindPositionForNewNodeContactPoint(int width, int height,
}
if (freeRectangles[i].width >= height && freeRectangles[i].height >= width)
{
- int score = ContactPointScoreNode(freeRectangles[i].x, freeRectangles[i].y, width, height);
+ int score = ContactPointScoreNode(freeRectangles[i].x, freeRectangles[i].y, height, width);
if (score > bestContactScore)
{
bestNode.x = freeRectangles[i].x;

0 comments on commit 887ffb4

Please sign in to comment.