diff --git a/Videos/OneLoneCoder_PGE_CircleVsRect.cpp b/Videos/OneLoneCoder_PGE_CircleVsRect.cpp index ee5d923..dbf91cf 100644 --- a/Videos/OneLoneCoder_PGE_CircleVsRect.cpp +++ b/Videos/OneLoneCoder_PGE_CircleVsRect.cpp @@ -149,7 +149,7 @@ public: olc::vi2d vCurrentCell = object.vPos.floor(); olc::vi2d vTargetCell = vPotentialPosition; olc::vi2d vAreaTL = (vCurrentCell.min(vTargetCell) - olc::vi2d(1, 1)).max({ 0,0 }); - olc::vi2d vAreaBR = (vCurrentCell.max(vTargetCell) + olc::vi2d(1, 1)).min(vWorldSize); + olc::vi2d vAreaBR = (vCurrentCell.max(vTargetCell) + olc::vi2d(1, 1)).min(vWorldSize - olc::vi2d(1, 1)); olc::vf2d vRayToNearest; @@ -242,4 +242,4 @@ int main() if (demo.Construct(640, 480, 2, 2)) demo.Start(); return 0; -} \ No newline at end of file +}