From 0f036b69ffd044de5a8a91b3c196a8f6abddeec6 Mon Sep 17 00:00:00 2001 From: "Evgeny Grechnikov (Diamond)" Date: Sun, 1 Aug 2010 23:15:10 +0000 Subject: [PATCH] fix calculation of draw_limits git-svn-id: svn://kolibrios.org@1550 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/gui/window.inc | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/kernel/trunk/gui/window.inc b/kernel/trunk/gui/window.inc index e2f8cff799..e4886fc151 100644 --- a/kernel/trunk/gui/window.inc +++ b/kernel/trunk/gui/window.inc @@ -1223,30 +1223,33 @@ window._.invalidate_screen: ;////////////////////////////////////////////////// push eax ebx ; TODO: do we really need `draw_limits`? + ; Yes, they are used by background drawing code. mov ecx, [eax + BOX.left] mov edx, [ebx + BOX.left] cmp ecx, edx jle @f - xchg ecx, edx + mov ecx, edx @@: mov [draw_limits.left], ecx - mov ecx, [eax + BOX.width] - cmp ecx, [ebx + BOX.width] + mov ecx, [eax + BOX.left] + add ecx, [eax + BOX.width] + add edx, [ebx + BOX.width] + cmp ecx, edx jae @f - mov ecx, [ebx + BOX.width] - @@: add ecx, edx - mov [draw_limits.right], ecx + mov ecx, edx + @@: mov [draw_limits.right], ecx mov ecx, [eax + BOX.top] mov edx, [ebx + BOX.top] cmp ecx, edx jle @f - xchg ecx, edx + mov ecx, edx @@: mov [draw_limits.top], ecx - mov ecx, [eax + BOX.height] - cmp ecx, [ebx + BOX.height] + mov ecx, [eax + BOX.top] + add ecx, [eax + BOX.height] + add edx, [ebx + BOX.height] + cmp ecx, edx jae @f - mov ecx, [ebx + BOX.height] - @@: add ecx, edx - mov [draw_limits.bottom], ecx + mov ecx, edx + @@: mov [draw_limits.bottom], ecx ; recalculate screen buffer at old position push ebx