mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
Simplify the math.
svn path=/trunk/; revision=63560
This commit is contained in:
parent
1476e535cf
commit
cd934cf648
1 changed files with 3 additions and 4 deletions
|
@ -167,12 +167,11 @@ CopyLines(PTEXTMODE_SCREEN_BUFFER Buffer,
|
|||
}
|
||||
else // if (End->Y > Begin->Y)
|
||||
{
|
||||
NumChars = (Buffer->ScreenBufferSize.X - 1) - (Begin->X) + 1;
|
||||
NumChars = Buffer->ScreenBufferSize.X - Begin->X;
|
||||
|
||||
if (Begin->Y + 1 <= End->Y - 1)
|
||||
if (End->Y >= Begin->Y + 2)
|
||||
{
|
||||
NumChars += ( (Buffer->ScreenBufferSize.X - 1) + 1 ) *
|
||||
( (End->Y - 1) - (Begin->Y + 1) + 1);
|
||||
NumChars += (End->Y - Begin->Y - 1) * Buffer->ScreenBufferSize.X;
|
||||
}
|
||||
|
||||
NumChars += End->X + 1;
|
||||
|
|
Loading…
Reference in a new issue