forked from KolibriOS/kolibrios
kiv: fixed calculating window size for files containing several frames of different size (*.ico)
git-svn-id: svn://kolibrios.org@2036 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
f029842a53
commit
b63e3a476f
@ -338,6 +338,17 @@ free_img_data:
|
|||||||
update_image_sizes:
|
update_image_sizes:
|
||||||
pushf
|
pushf
|
||||||
mov edx, [eax + Image.Width]
|
mov edx, [eax + Image.Width]
|
||||||
|
test [eax + Image.Flags], Image.IsAnimated
|
||||||
|
jnz .not_in_row
|
||||||
|
push eax
|
||||||
|
@@: cmp [eax + Image.Next], 0
|
||||||
|
jz @f
|
||||||
|
mov eax, [eax + Image.Next]
|
||||||
|
add edx, [eax + Image.Width]
|
||||||
|
inc edx
|
||||||
|
jmp @b
|
||||||
|
@@: pop eax
|
||||||
|
.not_in_row:
|
||||||
mov [draw_width], edx
|
mov [draw_width], edx
|
||||||
add edx, 19
|
add edx, 19
|
||||||
cmp edx, 40 + 25*9
|
cmp edx, 40 + 25*9
|
||||||
@ -346,6 +357,18 @@ update_image_sizes:
|
|||||||
@@:
|
@@:
|
||||||
mov [wnd_width], edx
|
mov [wnd_width], edx
|
||||||
mov esi, [eax + Image.Height]
|
mov esi, [eax + Image.Height]
|
||||||
|
test [eax + Image.Flags], Image.IsAnimated
|
||||||
|
jnz .max_equals_first
|
||||||
|
push eax
|
||||||
|
@@: cmp [eax + Image.Next], 0
|
||||||
|
jz @f
|
||||||
|
mov eax, [eax + Image.Next]
|
||||||
|
cmp esi, [eax + Image.Height]
|
||||||
|
jae @b
|
||||||
|
mov esi, [eax + Image.Height]
|
||||||
|
jmp @b
|
||||||
|
@@: pop eax
|
||||||
|
.max_equals_first:
|
||||||
mov [draw_height], esi
|
mov [draw_height], esi
|
||||||
add esi, 44
|
add esi, 44
|
||||||
mov [wnd_height], esi
|
mov [wnd_height], esi
|
||||||
@ -688,7 +711,9 @@ draw_window:
|
|||||||
mcall 13, , <0, 35>, 0xFFFFFF
|
mcall 13, , <0, 35>, 0xFFFFFF
|
||||||
mov ecx, [procinfo + 66]
|
mov ecx, [procinfo + 66]
|
||||||
inc ecx
|
inc ecx
|
||||||
mov esi, [draw_height]
|
; mov esi, [draw_height] ; we can not use [draw_height] here because for *.ico files containing several frames
|
||||||
|
mov esi, [image] ; with different size window height should depend on maximum frame height, not the first one
|
||||||
|
mov esi, [esi+Image.Height] ;
|
||||||
add esi, 35
|
add esi, 35
|
||||||
sub ecx, esi
|
sub ecx, esi
|
||||||
jbe @f
|
jbe @f
|
||||||
@ -703,7 +728,9 @@ draw_window:
|
|||||||
add ecx, 35*10000h - 35
|
add ecx, 35*10000h - 35
|
||||||
__mov ebx, 0, 5
|
__mov ebx, 0, 5
|
||||||
mcall
|
mcall
|
||||||
mov esi, [draw_width]
|
; mov esi, [draw_width] ; we can not use [draw_width] here because for *.ico files containing several frames
|
||||||
|
mov esi, [image] ; with different size window width should depend on the sum of width of all frames
|
||||||
|
mov esi, [esi + Image.Width] ;
|
||||||
add esi, ebx
|
add esi, ebx
|
||||||
mov ebx, [procinfo+62]
|
mov ebx, [procinfo+62]
|
||||||
inc ebx
|
inc ebx
|
||||||
|
Loading…
Reference in New Issue
Block a user