Author: hbelusca
Date: Sun Jun 8 17:36:12 2014
New Revision: 63560
URL:
http://svn.reactos.org/svn/reactos?rev=63560&view=rev
Log:
Simplify the math.
Modified:
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c [iso-8859-1] Sun Jun 8
17:36:12 2014
@@ -167,12 +167,11 @@
}
else // if (End->Y > Begin->Y)
{
- NumChars = (Buffer->ScreenBufferSize.X - 1) - (Begin->X) + 1;
-
- if (Begin->Y + 1 <= End->Y - 1)
- {
- NumChars += ( (Buffer->ScreenBufferSize.X - 1) + 1 ) *
- ( (End->Y - 1) - (Begin->Y + 1) + 1);
+ NumChars = Buffer->ScreenBufferSize.X - Begin->X;
+
+ if (End->Y >= Begin->Y + 2)
+ {
+ NumChars += (End->Y - Begin->Y - 1) * Buffer->ScreenBufferSize.X;
}
NumChars += End->X + 1;