forked from KolibriOS/kolibrios
Fixed unaligned text problem
git-svn-id: svn://kolibrios.org@4824 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
cbeff23cbd
commit
4f36d073fd
@ -13,7 +13,7 @@
|
|||||||
;; ;;
|
;; ;;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
version equ '0.22'
|
version equ '0.23'
|
||||||
|
|
||||||
; connection status
|
; connection status
|
||||||
STATUS_DISCONNECTED = 0
|
STATUS_DISCONNECTED = 0
|
||||||
@ -24,6 +24,7 @@ STATUS_CONNECTED = 3
|
|||||||
; window flags
|
; window flags
|
||||||
FLAG_UPDATED = 1 shl 0
|
FLAG_UPDATED = 1 shl 0
|
||||||
FLAG_RECEIVING_NAMES = 1 shl 1
|
FLAG_RECEIVING_NAMES = 1 shl 1
|
||||||
|
FLAG_SCROLL_LOW = 1 shl 2
|
||||||
|
|
||||||
; window types
|
; window types
|
||||||
WINDOWTYPE_NONE = 0
|
WINDOWTYPE_NONE = 0
|
||||||
@ -412,7 +413,13 @@ mouse:
|
|||||||
push dword scroll2
|
push dword scroll2
|
||||||
call [scrollbar_mouse]
|
call [scrollbar_mouse]
|
||||||
mov edi, [window_active]
|
mov edi, [window_active]
|
||||||
|
and [edi+window.flags], not FLAG_SCROLL_LOW
|
||||||
mov edx, [scroll2.position]
|
mov edx, [scroll2.position]
|
||||||
|
add edx, [scroll2.cur_area]
|
||||||
|
sub edx, [scroll2.max_area]
|
||||||
|
jne @f
|
||||||
|
or [edi+window.flags], FLAG_SCROLL_LOW
|
||||||
|
@@: mov edx, [scroll2.position]
|
||||||
sub edx, [edi + window.text_line_print]
|
sub edx, [edi + window.text_line_print]
|
||||||
je @f
|
je @f
|
||||||
call draw_channel_text.scroll_to_pos
|
call draw_channel_text.scroll_to_pos
|
||||||
|
@ -179,12 +179,13 @@ draw_channel_text:
|
|||||||
mov [edi + window.text_scanned], esi
|
mov [edi + window.text_scanned], esi
|
||||||
|
|
||||||
; Is scrollbar at lowest position?
|
; Is scrollbar at lowest position?
|
||||||
mov edx, [scroll2.position]
|
test [edi + window.flags], FLAG_SCROLL_LOW
|
||||||
test edx, edx
|
jnz .yesscroll ;Yes
|
||||||
jz .yesscroll
|
cmp [scroll2.all_redraw], 1 ;No
|
||||||
add edx, [scroll2.cur_area]
|
jnz .noscroll
|
||||||
sub edx, [scroll2.max_area]
|
mov edx, [textbox_height]
|
||||||
jne .noscroll
|
sub edx, [edi + window.text_line_print]
|
||||||
|
jg .noscroll
|
||||||
.yesscroll:
|
.yesscroll:
|
||||||
; Scrollbar was at lowest position, scroll down automatically when new text arrived.
|
; Scrollbar was at lowest position, scroll down automatically when new text arrived.
|
||||||
mov edx, [edi + window.text_lines]
|
mov edx, [edi + window.text_lines]
|
||||||
|
@ -36,6 +36,7 @@ window_create_textbox:
|
|||||||
|
|
||||||
mov [ebx + window.data_ptr], eax
|
mov [ebx + window.data_ptr], eax
|
||||||
mov [ebx + window.flags], 0
|
mov [ebx + window.flags], 0
|
||||||
|
or [ebx + window.flags], FLAG_SCROLL_LOW
|
||||||
|
|
||||||
add eax, window_data.text+2 ; let text begin at offset 2, this way the text will be prepended with two null bytes
|
add eax, window_data.text+2 ; let text begin at offset 2, this way the text will be prepended with two null bytes
|
||||||
mov [ebx + window.text_start], eax
|
mov [ebx + window.text_start], eax
|
||||||
|
Loading…
Reference in New Issue
Block a user