Limit selection to window border

svn path=/trunk/; revision=19897
This commit is contained in:
Gé van Geldorp 2005-12-04 22:34:07 +00:00
parent 72510b8edb
commit 949a0178cf

View file

@ -725,7 +725,15 @@ GuiConsoleMouseMove(HWND hWnd, WPARAM wParam, LPARAM lParam)
rc.left = GuiData->SelectionStart.x; rc.left = GuiData->SelectionStart.x;
rc.top = GuiData->SelectionStart.y; rc.top = GuiData->SelectionStart.y;
rc.right = (pt.x >= 0 ? (pt.x / GuiData->CharWidth) + 1 : 0); rc.right = (pt.x >= 0 ? (pt.x / GuiData->CharWidth) + 1 : 0);
if (Console->Size.X < rc.right)
{
rc.right = Console->Size.X;
}
rc.bottom = (pt.y >= 0 ? (pt.y / GuiData->CharHeight) + 1 : 0); rc.bottom = (pt.y >= 0 ? (pt.y / GuiData->CharHeight) + 1 : 0);
if (Console->Size.Y < rc.bottom)
{
rc.bottom = Console->Size.Y;
}
/* exchange left/top with right/bottom if required */ /* exchange left/top with right/bottom if required */
if(rc.left >= rc.right) if(rc.left >= rc.right)