Fix mouse comparisons for shell
This commit is contained in:
parent
f726a128ed
commit
86050094eb
26
shell.asm
26
shell.asm
|
@ -228,23 +228,25 @@ mouse:
|
||||||
|
|
||||||
cmp byte [si + window.status], WINDOW_MOVE
|
cmp byte [si + window.status], WINDOW_MOVE
|
||||||
jne .not_move
|
jne .not_move
|
||||||
call move
|
call move
|
||||||
.not_move:
|
.not_move:
|
||||||
cmp byte [si + window.status], WINDOW_RESIZE
|
cmp byte [si + window.status], WINDOW_RESIZE
|
||||||
jne .not_resize
|
jne .not_resize
|
||||||
call resize
|
call resize
|
||||||
.not_resize:
|
.not_resize:
|
||||||
|
|
||||||
sub cx, [si + window.x]
|
cmp cx, [si + window.x]
|
||||||
jc .outside
|
jl .outside ; x < window_x
|
||||||
cmp [si + window.width], cx
|
cmp bx, [si + window.y]
|
||||||
jle .outside
|
jl .outside ; y < window_y
|
||||||
add cx, [si + window.x]
|
mov bp, [si + window.x]
|
||||||
sub bx, [si + window.y]
|
add bp, [si + window.width]
|
||||||
jc .outside
|
cmp bp, cx
|
||||||
cmp [si + window.height], bx
|
jle .outside ; window_x + window_width <= x
|
||||||
jle .outside
|
mov bp, [si + window.y]
|
||||||
add bx, [si + window.y]
|
add bp, [si + window.height]
|
||||||
|
cmp bp, bx
|
||||||
|
jle .outside ; window_y + window_height <= y
|
||||||
|
|
||||||
cmp byte [si + window.mouse_released_inside], 0
|
cmp byte [si + window.mouse_released_inside], 0
|
||||||
je .not_clicking
|
je .not_clicking
|
||||||
|
|
Loading…
Reference in New Issue