X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fquadtree.cpp;h=04630b7cf34862850e518e2cb0b86b911289c686;hp=e93a0f0fd839c496d92f39a765166b5d1c2712c1;hb=255065a607d82846c4a8b730000d547b3f080d0c;hpb=b2d6929dfb8cd94c0447b350c9bafaa573a4a834 diff --git a/src/quadtree.cpp b/src/quadtree.cpp index e93a0f0..04630b7 100644 --- a/src/quadtree.cpp +++ b/src/quadtree.cpp @@ -12,11 +12,11 @@ Rect TransformToQuadChild(const Rect& src, QuadTreeNodeChildren child_type) dst.h *= 2; if (child_type == QTC_BOTTOM_LEFT || child_type == QTC_BOTTOM_RIGHT) { - dst.x -= 1; + dst.y -= 1; } if (child_type == QTC_TOP_RIGHT || child_type == QTC_BOTTOM_RIGHT) { - dst.y -= 1; + dst.x -= 1; } return dst; } @@ -30,11 +30,11 @@ Rect TransformFromQuadChild(const Rect& src, QuadTreeNodeChildren child_type) dst.h *= 0.5; if (child_type == QTC_BOTTOM_LEFT || child_type == QTC_BOTTOM_RIGHT) { - dst.x += 1; + dst.y += 1; } if (child_type == QTC_TOP_RIGHT || child_type == QTC_BOTTOM_RIGHT) { - dst.y += 1; + dst.x += 1; } return dst; }