fix calculation of draw_limits

git-svn-id: svn://kolibrios.org@1550 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2010-08-01 23:15:10 +00:00
parent 15a6f2fd99
commit 0f036b69ff

View File

@ -1223,30 +1223,33 @@ window._.invalidate_screen: ;//////////////////////////////////////////////////
push eax ebx push eax ebx
; TODO: do we really need `draw_limits`? ; TODO: do we really need `draw_limits`?
; Yes, they are used by background drawing code.
mov ecx, [eax + BOX.left] mov ecx, [eax + BOX.left]
mov edx, [ebx + BOX.left] mov edx, [ebx + BOX.left]
cmp ecx, edx cmp ecx, edx
jle @f jle @f
xchg ecx, edx mov ecx, edx
@@: mov [draw_limits.left], ecx @@: mov [draw_limits.left], ecx
mov ecx, [eax + BOX.width] mov ecx, [eax + BOX.left]
cmp ecx, [ebx + BOX.width] add ecx, [eax + BOX.width]
add edx, [ebx + BOX.width]
cmp ecx, edx
jae @f jae @f
mov ecx, [ebx + BOX.width] mov ecx, edx
@@: add ecx, edx @@: mov [draw_limits.right], ecx
mov [draw_limits.right], ecx
mov ecx, [eax + BOX.top] mov ecx, [eax + BOX.top]
mov edx, [ebx + BOX.top] mov edx, [ebx + BOX.top]
cmp ecx, edx cmp ecx, edx
jle @f jle @f
xchg ecx, edx mov ecx, edx
@@: mov [draw_limits.top], ecx @@: mov [draw_limits.top], ecx
mov ecx, [eax + BOX.height] mov ecx, [eax + BOX.top]
cmp ecx, [ebx + BOX.height] add ecx, [eax + BOX.height]
add edx, [ebx + BOX.height]
cmp ecx, edx
jae @f jae @f
mov ecx, [ebx + BOX.height] mov ecx, edx
@@: add ecx, edx @@: mov [draw_limits.bottom], ecx
mov [draw_limits.bottom], ecx
; recalculate screen buffer at old position ; recalculate screen buffer at old position
push ebx push ebx