Rev 6026 | Rev 6596 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6026 | Rev 6097 | ||
---|---|---|---|
Line 205... | Line 205... | ||
205 | jl .noscroll |
205 | jl .noscroll |
206 | .yesscroll: |
206 | .yesscroll: |
207 | ; Scrollbar was at lowest position, scroll down automatically when new text arrived. |
207 | ; Scrollbar was at lowest position, scroll down automatically when new text arrived. |
208 | mov edx, [edi + window.text_lines] |
208 | mov edx, [edi + window.text_lines] |
209 | sub edx, [textbox_height] |
209 | sub edx, [textbox_height] |
- | 210 | jg @f |
|
- | 211 | mov [edi + window.text_line_print], 0 |
|
210 | jle .noscroll ; There are less lines of text than fit into the window, dont scroll.. |
212 | jmp .noscroll ; There are less lines of text than fit into the window, dont scroll.. |
- | 213 | @@: |
|
211 | sub edx, [edi + window.text_line_print] |
214 | sub edx, [edi + window.text_line_print] |
212 | je .noscroll ; We are already at the bottom pos, dont scroll.. |
215 | je .noscroll ; We are already at the bottom pos, dont scroll.. |
213 | .scroll_to_pos: ; edx = number of lines to go up/down (flags must indicate direction) |
216 | .scroll_to_pos: ; edx = number of lines to go up/down (flags must indicate direction) |
214 | pushf |
217 | pushf |
215 | add [edi + window.text_line_print], edx |
218 | add [edi + window.text_line_print], edx |
216 | mov esi, [edi + window.text_print] |
219 | mov esi, [edi + window.text_print] |
217 | popf |
220 | popf |
218 | ja .loop_forward |
221 | jg .loop_forward |
219 | std ; set direction flag so we can scan backwards |
222 | std ; set direction flag so we can scan backwards |
220 | dec esi |
223 | dec esi |
221 | dec esi ; move our cursor just in front of newline, for scanning backwards |
224 | dec esi ; move our cursor just in front of newline, for scanning backwards |
222 | .loop_backward: |
225 | .loop_backward: |
223 | call text_nextline |
226 | call text_nextline |