some fixes in mouse selection

git-svn-id: svn://kolibrios.org@6385 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2016-03-28 19:48:24 +00:00
parent 7ec2b06ca1
commit 410b1a3707
8 changed files with 180 additions and 396 deletions

View File

@ -43,6 +43,7 @@ include '../../../develop/libraries/box_lib/load_lib.mac'
include '../../../dll.inc' include '../../../dll.inc'
include '../../../libio.inc' include '../../../libio.inc'
;include '../../../develop/libraries/libs-dev/libimg/libimg.inc' ;include '../../../develop/libraries/libs-dev/libimg/libimg.inc'
;include '../../../debug.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
@ -261,6 +262,7 @@ OldY rd 1
MouseX rd 1 MouseX rd 1
MouseY rd 1 MouseY rd 1
MouseBut rd 1 ;ᮡëâ¨ï ®â ª­®¯®ª ¬ëè¨
Window_SizeX rd 1 Window_SizeX rd 1
Window_SizeY rd 1 Window_SizeY rd 1
Window_CordinatX rd 1 Window_CordinatX rd 1
@ -322,17 +324,17 @@ b_ellips rd 1
used_OldX rd 1 ;for draw hard contour used_OldX rd 1 ;for draw hard contour
used_OldY rd 1 used_OldY rd 1
rectangular_shade_x rd 1 ;ª®®à¤¨­ â  x ®¡« á⨠¤«ï ª®¯¨à®¢ ­¨ï
rectangular_shade_y rd 1
paste_img_w rd 1 ;è¨à¨­  ¢áâ ¢«ï¥¬®£® ¨§®¡à ¦¥­¨ï paste_img_w rd 1 ;è¨à¨­  ¢áâ ¢«ï¥¬®£® ¨§®¡à ¦¥­¨ï
paste_img_h rd 1 ;¢ëá®â  ¢áâ ¢«ï¥¬®£® ¨§®¡à ¦¥­¨ï paste_img_h rd 1 ;¢ëá®â  ¢áâ ¢«ï¥¬®£® ¨§®¡à ¦¥­¨ï
crossing_old_x rd 1 crossing_old_x rd 1 ;­ ç «ì­ ï ª®®à¤. x ®¡« á⨠ª®¯¨à®¢ ­¨ï
crossing_old_y rd 1 crossing_old_y rd 1 ;­ ç «ì­ ï ª®®à¤. y ®¡« á⨠ª®¯¨à®¢ ­¨ï
crossing rd 1 rectangular_shade_x rd 1 ;ª®­¥ç­ ï ª®®à¤. x ®¡« á⨠ª®¯¨à®¢ ­¨ï
finishing_crossing rd 1 rectangular_shade_y rd 1 ;ª®­¥ç­ ï ª®®à¤. y ®¡« á⨠ª®¯¨à®¢ ­¨ï
crossing rd 1 ;0 - ¢ë¤¥«¥­¨ï ­¥â, 1 - ¨¤¥â ¯à®æ¥á ¢ë¤¥«¥­¨ï,
;2 - ¢ë¤¥«¥­¨¥ § ¢¥à襭®, 3 - ®¡« áâì ¢ë¤¥«¥­¨ï ¯¥à¥¬¥é ¥âáï
number_undo rd 1 number_undo rd 1
SpriteSizeX rd 1 SpriteSizeX rd 1 ;???
SpriteSizeY rd 1 SpriteSizeY rd 1 ;???
SpriteCoordinatX rd 1 SpriteCoordinatX rd 1
SpriteCoordinatY rd 1 SpriteCoordinatY rd 1
SpriteOldCoordinatX rd 1 SpriteOldCoordinatX rd 1
@ -340,7 +342,8 @@ SpriteOldCoordinatY rd 1
CursorsID rd 10 CursorsID rd 10
Activate_instrument rb 1 Activate_instrument rb 1 ;¥á«¨ à ¢­® 0 - â® ª®¯¨à®¢ ­¨¥ ⥪ã饣® ¡ãä¥à 
;¤«ï ¥£® । ªâ¨à®¢ ­¨ï, ¥á«¨ 1 - ⥪ã騩 ¡ãä¥à ­¥ ª®¯¨àã¥âáï
save_flag rb 1 save_flag rb 1
exit_from_work_arrea rb 1 exit_from_work_arrea rb 1
lastik_is_active rb 1 lastik_is_active rb 1

View File

@ -9,9 +9,7 @@ buttons:
jne @f jne @f
cmp [Activate_instrument],0 cmp [Activate_instrument],0
jne @f jne @f
cmp [crossing],1 ;mov [crossing],2
jne @f
mov [finishing_crossing],1
call TakeButtonInstruments call TakeButtonInstruments
jmp still jmp still
@@: @@:
@ -35,11 +33,9 @@ buttons:
;save instrumnets 10-40 ;save instrumnets 10-40
cmp eax,40 cmp eax,40
jae no_save_last_instrument jae @f
mov [Last_instrument],eax mov [Last_instrument],eax
@@:
no_save_last_instrument:
cmp eax,10 cmp eax,10
je still je still
@ -57,31 +53,22 @@ buttons:
je still je still
cmp eax,51 cmp eax,51
jne no_palette_ jne @f
call TakeButtonInstruments call TakeButtonInstruments
jmp still jmp still
@@:
no_palette_:
cmp eax,17 cmp eax,17
je still je still
cmp eax,21 cmp eax,21
jne no_allocation__ je still
and [Activate_instrument],0
jmp still
no_allocation__:
cmp eax,20 cmp eax,20
jne no_kontur__ jne @f
and [instrument_used],0 and [instrument_used],0
jmp still jmp still
@@:
no_kontur__:
call TakeButtonInstruments call TakeButtonInstruments
jmp still jmp still

View File

@ -11,6 +11,8 @@ mouse:
test eax,100b test eax,100b
jne still jne still
call GetMouseClick
call GetMouseCoordinats call GetMouseCoordinats
mov eax,[MouseX] mov eax,[MouseX]
mov ebx,[MouseY] mov ebx,[MouseY]
@ -29,11 +31,10 @@ mouse:
mouse_scroll: mouse_scroll:
mov [exit_from_work_arrea],1 ;mouse situated after work arrea mov [exit_from_work_arrea],1 ;mouse situated after work arrea
;scrollers ;scrollers
call GetMouseClick cmp [MouseBut],0
cmp eax,1 je still
jne still
call GetMouseCoordinats ;call GetMouseCoordinats
;interraction with horizontal scroller ;interraction with horizontal scroller
mov eax,[Scroll1CoordinatX] mov eax,[Scroll1CoordinatX]
mov ebx,[Scroll1CoordinatY] mov ebx,[Scroll1CoordinatY]
@ -179,12 +180,11 @@ mouse_in_work_arrea:
mov ebx,[Current_instrument] mov ebx,[Current_instrument]
call set_cursor call set_cursor
call GetMouseClick cmp [MouseBut],0
test eax,eax je no_use_instruments
jz no_use_instruments
cmp [Activate_instrument],0 cmp [Activate_instrument],0
jnz no_undo___ jne no_undo___
;------------begin copy for undo------------- ;------------begin copy for undo-------------
;copy bufer_0 -> bufer_2 ;copy bufer_0 -> bufer_2
mov edi,[PointerToCopyPicture2] mov edi,[PointerToCopyPicture2]
@ -210,11 +210,9 @@ mouse_in_work_arrea:
;--------------end copy for undo------------- ;--------------end copy for undo-------------
no_undo___: no_undo___:
call TakeButtonInstruments call TakeButtonInstruments
jmp still jmp still
no_use_instruments: no_use_instruments:
mov eax,[Current_instrument]
and [Activate_instrument],0 and [Activate_instrument],0
jmp still jmp still
;----------------------------------------------- ;-----------------------------------------------
@ -232,5 +230,6 @@ GetMouseCoordinats:
;-------get mouse attributs---------------------- ;-------get mouse attributs----------------------
;------------------------------------------------ ;------------------------------------------------
GetMouseClick: GetMouseClick:
mcall SF_MOUSE_GET,SSF_BUTTON mcall SF_MOUSE_GET,SSF_BUTTON_EXT
mov [MouseBut],eax
ret ret

View File

@ -1027,7 +1027,7 @@ TakeButtonInstruments:
jne no_1_ jne no_1_
mov [k],1 mov [k],1
call scrollbar_move_00 call scrollbar_move_00
and [Current_instrument],0 and [Current_instrument],0 ;???
call drawwin call drawwin
ret ret
no_1_: no_1_:
@ -1086,318 +1086,131 @@ TakeButtonInstruments:
cmp eax,21 cmp eax,21
jne no_allocation jne no_allocation
cmp [instrument_used],0
jnz instrument_not_finished_work
mov al,[Activate_instrument]
test al,al
jnz no_new_allocation_xy
mov eax,[ScreenX]
mov ebx,[ScreenY]
add eax,[PosX]
add ebx,[PosY]
mov [OldX],eax
mov [OldY],ebx
inc eax
inc ebx
mov [rectangular_shade_x],eax
mov [rectangular_shade_y],ebx
mov [Activate_instrument],1 mov [Activate_instrument],1
mov [instrument_used],1
and [crossing],0
and [finishing_crossing],0
xor eax,eax
mov ecx,mem_flood_f/4
mov edi,[ReserveArray]
cld
rep stosd
ret
no_new_allocation_xy:
instrument_not_finished_work:
mov al,[instrument_used]
test al,al
jz no_change_coordinats
cmp [Activate_instrument],0
jnz no_change_coordinats
;save coordinates as old if crossing=0
cmp [crossing],0
jnz no_save_coordinate_of_crossing
mov eax,[OldX]
mov ebx,[OldY]
cmp eax,[rectangular_shade_x]
jl no_remove_x
mov ecx,[rectangular_shade_x]
mov [OldX],ecx ; OldX <-----> rectangulare_shade_x
mov [rectangular_shade_x],eax
no_remove_x:
cmp ebx,[rectangular_shade_y]
jl no_remove_y
mov ecx,[rectangular_shade_y]
mov [OldY],ecx ; OldY <-----> rectangulare_shade_y
mov [rectangular_shade_y],ebx
no_remove_y:
mov eax,[ScreenX]
mov ebx,[ScreenY]
add eax,[PosX]
add ebx,[PosY]
mov [crossing_old_x],eax
mov [crossing_old_y],ebx
mov [crossing],1
mov eax,[OldX]
mov ebx,[OldY]
inc eax
inc ebx
mov [SpriteCoordinatX],eax
mov [SpriteCoordinatY],ebx
mov [SpriteOldCoordinatX],eax
mov [SpriteOldCoordinatY],ebx
mov esi,[rectangular_shade_x]
mov edi,[rectangular_shade_y]
sub esi,eax
jns @f
neg esi ;sign sprite size x
@@:
sub edi,ebx
jns @f
neg edi ;sign sprite size y
@@:
test esi,esi
jnz @f
mov esi,1 ;null sprite x
@@:
test edi,edi
jnz @f
mov edi,1 ;null sprite y
@@:
mov [SpriteSizeX],esi
mov [SpriteSizeY],edi
call SaveFonForSprite
no_save_coordinate_of_crossing:
cmp [crossing],0
je no_test_crossing_with_work_arrea
;if mouse situatad after allocation than exit
push [ScreenX]
push [ScreenY]
call GetScreenCordinats call GetScreenCordinats
mov eax,[OldX] bt [MouseBut],8 ;left button down
mov ebx,[OldY] jnc .left_but_down
cmp [crossing],2
jne @f
;move old selection
mov eax,[crossing_old_x]
mov ebx,[crossing_old_y]
mov ecx,[ScreenX] mov ecx,[ScreenX]
mov edx,[ScreenY] mov edx,[ScreenY]
mov esi,[SpriteSizeX]
mov edi,[SpriteSizeY]
add ecx,[PosX] add ecx,[PosX]
add edx,[PosY] add edx,[PosY]
inc esi mov esi,[rectangular_shade_x]
inc edi mov edi,[rectangular_shade_y]
sub esi,eax
sub edi,ebx
call columnus call columnus
test eax,eax test eax,eax
jnz crossing_with_work_area jz @f
mov [finishing_crossing],1 mov [crossing],3
crossing_with_work_area: mov [OldX],ecx
mov [OldY],edx
pop [ScreenY] jmp selection_update
pop [ScreenX] @@:
;start new selection
no_test_crossing_with_work_arrea:
mov eax,[ScreenX] mov eax,[ScreenX]
mov ebx,[ScreenY]
add eax,[PosX] add eax,[PosX]
add ebx,[PosY] mov [crossing_old_x],eax
mov ecx,eax mov [rectangular_shade_x],eax
mov edx,ebx mov eax,[ScreenY]
sub eax,[crossing_old_x] ;dx=(x-oldx) add eax,[PosY]
sub ebx,[crossing_old_y] ;dy=(y-oldy) mov [crossing_old_y],eax
mov [crossing_old_x],ecx mov [rectangular_shade_y],eax
mov [crossing_old_y],edx mov [crossing],1
jmp selection_update
.left_but_down:
add [OldX],eax ;x1=x1+dx bt [MouseBut],0 ;left button press
add [OldY],ebx ;y1=y1+dy jnc .no_mouse_move
add [rectangular_shade_x],eax ;x2=x2+dx cmp [crossing],3
add [rectangular_shade_y],ebx ;y2+y2+dy jne .no_sel_move
;move selection
mov eax,[OldX] mov eax,[ScreenX]
mov ebx,[OldY] add eax,[PosX]
inc eax sub eax,[OldX]
inc ebx add [OldX],eax
mov [SpriteCoordinatX],eax mov ebx,[crossing_old_x]
mov [SpriteCoordinatY],ebx add ebx,eax
cmp ebx,0
cmp [SpriteCoordinatX],0 jge @f
jns @f ;exit from left border
mov [SpriteCoordinatX],1 ;null sprite coordinat x sub eax,ebx
@@: @@:
cmp [SpriteCoordinatY],0 add [crossing_old_x],eax
jns @f add [rectangular_shade_x],eax
mov [SpriteCoordinatY],1 ;null sprite coordinat y mov eax,[ScreenY]
add eax,[PosY]
sub eax,[OldY]
add [OldY],eax
mov ebx,[crossing_old_y]
add ebx,eax
cmp ebx,0
jge @f
;exit from top border
sub eax,ebx
@@: @@:
add [crossing_old_y],eax
add [rectangular_shade_y],eax
jmp selection_update
.no_sel_move:
;resize selection
mov eax,[ScreenX]
add eax,[PosX]
mov [rectangular_shade_x],eax
mov eax,[ScreenY]
add eax,[PosY]
mov [rectangular_shade_y],eax
jmp selection_update
.no_mouse_move:
mov esi,[rectangular_shade_x] bt [MouseBut],16 ;left button up
mov edi,[rectangular_shade_y] jnc .left_but_up
;finish selection
sub esi,[OldX] mov eax,[crossing_old_x]
jns @f mov ebx,[rectangular_shade_x]
neg esi cmp eax,ebx
jle @f
mov [crossing_old_x],ebx
mov [rectangular_shade_x],eax
@@: @@:
sub edi,[OldY] mov eax,[crossing_old_y]
jns @f
neg edi
@@:
mov ecx,[OldX]
mov edx,[OldY]
sub ecx,[PosX]
jns @f
xor ecx,ecx
add ecx,[PosX]
mov [OldX],ecx
add ecx,esi
mov [rectangular_shade_x],ecx
@@:
sub edx,[PosY]
jns @f
xor edx,edx
add edx,[PosY]
mov [OldY],edx
add edx,edi
mov [rectangular_shade_y],edx
@@:
mov ecx,[Picture_SizeX]
sub ecx,esi
cmp [OldX],ecx
jl @f
dec ecx
mov [OldX],ecx
add ecx,esi
mov [rectangular_shade_x],ecx
@@:
mov edx,[Picture_SizeY]
sub edx,edi
cmp [OldY],edx
jl @f
dec edx
mov [OldY],edx
add edx,edi
mov [rectangular_shade_y],edx
@@:
mov eax,[rectangular_shade_x]
mov ebx,[rectangular_shade_y] mov ebx,[rectangular_shade_y]
sub eax,[PosX] cmp eax,ebx
sub ebx,[PosY] jle @f
mov [ScreenX],eax mov [crossing_old_y],ebx
mov [ScreenY],ebx mov [rectangular_shade_y],eax
no_change_coordinats: @@:
mov [crossing],2
ret
.left_but_up:
;put saved pixels bt [MouseBut],9 ;right button down
square_width_put jnc .right_but_down
;delete select
cmp [DrawSprite_flag],1 mov [crossing],0
jne no_activate_put_fon_ jmp selection_update
.right_but_down:
if 0
cmp [Paste_flag],1 cmp [Paste_flag],1
je @f je @f
call PutFonForSprite call PutFonForSprite
@@: @@:
and [Paste_flag],0
no_activate_put_fon_:
cmp [finishing_crossing],0
jz not_finish_from_instrument_crossing
and [Activate_instrument],0
and [crossing],0
and [instrument_used],0
and [DrawSprite_flag],0
call MovePictureToWorkScreen
ret
not_finish_from_instrument_crossing:
;calculate line
mov ebx,[ReserveArray]
add ebx,4
mov eax,[PointerToPicture]
mov ecx,[Picture_SizeX]
mov edx,[OldX]
shl edx,16
add edx,[OldY]
mov esi,[ScreenX]
mov edi,[ScreenY]
add esi,[PosX]
add edi,[PosY]
mov ebp,[Picture_SizeX]
dec ebp
cmp esi,ebp
jl @f
mov esi,ebp ;minimum x allocation
@@:
mov ebp,[Picture_SizeY]
dec ebp
cmp edi,ebp
jl @f
mov edi,ebp ;minimum y allocation
@@:
call calculate_rectangle
;save color pixels in ReserveArray
square_width_save
cmp [DrawSprite_flag],1 cmp [DrawSprite_flag],1
jne @f jne @f
;save current coordinats as old
mov eax,[SpriteCoordinatX]
mov ebx,[SpriteCoordinatY]
mov [SpriteOldCoordinatX],eax
mov [SpriteOldCoordinatY],ebx
call SaveFonForSprite call SaveFonForSprite
@@:
cmp [DrawSprite_flag],1
jne @f
call DrawSprite call DrawSprite
@@: @@:
end if
mov al,[instrument_used] selection_update:
test al,al
jz no_change_coordinats
cmp [Activate_instrument],0
jz no_save_shades
mov eax,[ScreenX]
mov ebx,[ScreenY]
add eax,[PosX]
add ebx,[PosY]
mov [rectangular_shade_x],eax
mov [rectangular_shade_y],ebx
no_save_shades:
call MovePictureToWorkScreen call MovePictureToWorkScreen
ret ret
no_allocation: no_allocation:

View File

@ -22,7 +22,6 @@
mov [line_width],1 mov [line_width],1
mov [lastik_is_active],0 mov [lastik_is_active],0
and [crossing],0 and [crossing],0
and [finishing_crossing],0
and [number_undo],0 and [number_undo],0
and [instrument_used],0 and [instrument_used],0
and [DrawSprite_flag],0 and [DrawSprite_flag],0

View File

@ -64,6 +64,8 @@ init_main_menu:
stdcall [ksubmenu_add], [main_menu_edit], eax stdcall [ksubmenu_add], [main_menu_edit], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Edit_ClS, 0x66 stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Edit_ClS, 0x66
stdcall [ksubmenu_add], [main_menu_edit], eax stdcall [ksubmenu_add], [main_menu_edit], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Edit_SelectAll, 0x67
stdcall [ksubmenu_add], [main_menu_edit], eax
; add 'Edit' menu to main ; add 'Edit' menu to main
stdcall [kmenuitem_new], KMENUITEM_SUBMENU, sz_main_menu_Edit, [main_menu_edit] stdcall [kmenuitem_new], KMENUITEM_SUBMENU, sz_main_menu_Edit, [main_menu_edit]
@ -126,6 +128,7 @@ button_handler_main_menu:
menu_set 0x64, 6,4 menu_set 0x64, 6,4
menu_set 0x65, 6,5 menu_set 0x65, 6,5
menu_set 0x66, 6,6 menu_set 0x66, 6,6
menu_set 0x67, 6,7
menu_set 0x51, 5,1 menu_set 0x51, 5,1
menu_set 0x52, 5,2 menu_set 0x52, 5,2
menu_set 0x53, 5,3 menu_set 0x53, 5,3
@ -162,6 +165,7 @@ sz_main_menu_Edit_Copy db 'Copy', 0
sz_main_menu_Edit_Paste db 'Paste', 0 sz_main_menu_Edit_Paste db 'Paste', 0
sz_main_menu_Edit_Cut db 'Cut', 0 sz_main_menu_Edit_Cut db 'Cut', 0
sz_main_menu_Edit_ClS db 'Clear screen', 0 sz_main_menu_Edit_ClS db 'Clear screen', 0
sz_main_menu_Edit_SelectAll db 'Select all', 0
sz_main_menu_Instr db 'Instruments', 0 sz_main_menu_Instr db 'Instruments', 0
sz_main_menu_Instr_Pencil db 'Pencil', 0 sz_main_menu_Instr_Pencil db 'Pencil', 0

View File

@ -257,19 +257,14 @@ no_redo:
cmp [number_menu],3 cmp [number_menu],3
jne no_copy jne no_copy
cmp [instrument_used],1 mov eax,[crossing_old_x]
jne end_menu mov ebx,[crossing_old_y]
cmp [Activate_instrument],0
jne end_menu
mov eax,[OldX]
mov ebx,[OldY]
cmp eax,[rectangular_shade_x] cmp eax,[rectangular_shade_x]
jl no_remove_x_copy jl no_remove_x_copy
mov ecx,[rectangular_shade_x] mov ecx,[rectangular_shade_x]
mov [OldX],ecx ; OldX <-----> rectangulare_shade_x mov [crossing_old_x],ecx ; crossing_old_x <-----> rectangulare_shade_x
mov [rectangular_shade_x],eax mov [rectangular_shade_x],eax
no_remove_x_copy: no_remove_x_copy:
@ -277,12 +272,12 @@ no_remove_x_copy:
jl no_remove_y_copy jl no_remove_y_copy
mov ecx,[rectangular_shade_y] mov ecx,[rectangular_shade_y]
mov [OldY],ecx ; OldY <-----> rectangulare_shade_y mov [crossing_old_y],ecx ; crossing_old_y <-----> rectangulare_shade_y
mov [rectangular_shade_y],ebx mov [rectangular_shade_y],ebx
no_remove_y_copy: no_remove_y_copy:
mov eax,[OldX] mov eax,[crossing_old_x]
mov ebx,[OldY] mov ebx,[crossing_old_y]
mov ecx,[rectangular_shade_x] mov ecx,[rectangular_shade_x]
mov edx,[rectangular_shade_y] mov edx,[rectangular_shade_y]
inc eax inc eax
@ -314,10 +309,10 @@ no_signum_fill_r_y_copy:
mov edx,[PointerToEditBufer] mov edx,[PointerToEditBufer]
mov eax,[rectangular_shade_x] mov eax,[rectangular_shade_x]
sub eax,[OldX] sub eax,[crossing_old_x]
mov [edx],eax ;image.w mov [edx],eax ;image.w
mov eax,[rectangular_shade_y] mov eax,[rectangular_shade_y]
sub eax,[OldY] sub eax,[crossing_old_y]
mov [edx+4],eax ;image.h mov [edx+4],eax ;image.h
mov dword[edx+8],24 ;bit in pixel mov dword[edx+8],24 ;bit in pixel
add edx,12 ;copy image parametrs add edx,12 ;copy image parametrs
@ -365,20 +360,14 @@ no_copy:
cmp [number_menu],4 cmp [number_menu],4
jne no_paste jne no_paste
cmp [instrument_used],1 mov eax,[crossing_old_x]
jne no_paste mov ebx,[crossing_old_y]
cmp [Activate_instrument],0
jne no_paste
mov eax,[OldX]
mov ebx,[OldY]
cmp eax,[rectangular_shade_x] cmp eax,[rectangular_shade_x]
jl no_remove_x_paste jl no_remove_x_paste
mov ecx,[rectangular_shade_x] mov ecx,[rectangular_shade_x]
mov [OldX],ecx ; OldX <-----> rectangulare_shade_x mov [crossing_old_x],ecx ; crossing_old_x <-----> rectangulare_shade_x
mov [rectangular_shade_x],eax mov [rectangular_shade_x],eax
no_remove_x_paste: no_remove_x_paste:
@ -386,12 +375,12 @@ no_remove_x_paste:
jl no_remove_y_paste jl no_remove_y_paste
mov ecx,[rectangular_shade_y] mov ecx,[rectangular_shade_y]
mov [OldY],ecx ; OldY <-----> rectangulare_shade_y mov [crossing_old_y],ecx ; crossing_old_y <-----> rectangulare_shade_y
mov [rectangular_shade_y],ebx mov [rectangular_shade_y],ebx
no_remove_y_paste: no_remove_y_paste:
mov eax,[OldX] mov eax,[crossing_old_x]
mov ebx,[OldY] mov ebx,[crossing_old_y]
mov ecx,[rectangular_shade_x] mov ecx,[rectangular_shade_x]
mov edx,[rectangular_shade_y] mov edx,[rectangular_shade_y]
inc eax inc eax
@ -422,10 +411,10 @@ no_signum_fill_r_y_paste:
cmp dword[edx+8],24 cmp dword[edx+8],24
jne end_menu jne end_menu
mov eax,[edx] mov eax,[edx]
add eax,[OldX] add eax,[crossing_old_x]
mov [paste_img_w],eax mov [paste_img_w],eax
mov eax,[edx+4] mov eax,[edx+4]
add eax,[OldY] add eax,[crossing_old_y]
mov [paste_img_h],eax mov [paste_img_h],eax
add edx,12 ;copy image parametrs add edx,12 ;copy image parametrs
mov [y],edi mov [y],edi
@ -473,20 +462,14 @@ no_paste:
cmp [number_menu],5 cmp [number_menu],5
jne no_cut jne no_cut
cmp [instrument_used],1 mov eax,[crossing_old_x]
jne no_cut mov ebx,[crossing_old_y]
cmp [Activate_instrument],0
jne no_cut
mov eax,[OldX]
mov ebx,[OldY]
cmp eax,[rectangular_shade_x] cmp eax,[rectangular_shade_x]
jl no_remove_x_cut jl no_remove_x_cut
mov ecx,[rectangular_shade_x] mov ecx,[rectangular_shade_x]
mov [OldX],ecx ; OldX <-----> rectangulare_shade_x mov [crossing_old_x],ecx ; crossing_old_x <-----> rectangulare_shade_x
mov [rectangular_shade_x],eax mov [rectangular_shade_x],eax
no_remove_x_cut: no_remove_x_cut:
@ -494,12 +477,12 @@ no_remove_x_cut:
jl no_remove_y_cut jl no_remove_y_cut
mov ecx,[rectangular_shade_y] mov ecx,[rectangular_shade_y]
mov [OldY],ecx ; OldY <-----> rectangulare_shade_y mov [crossing_old_y],ecx ; crossing_old_y <-----> rectangulare_shade_y
mov [rectangular_shade_y],ebx mov [rectangular_shade_y],ebx
no_remove_y_cut: no_remove_y_cut:
mov eax,[OldX] mov eax,[crossing_old_x]
mov ebx,[OldY] mov ebx,[crossing_old_y]
mov ecx,[rectangular_shade_x] mov ecx,[rectangular_shade_x]
mov edx,[rectangular_shade_y] mov edx,[rectangular_shade_y]
inc eax inc eax
@ -570,25 +553,21 @@ no_cut:
no_cleare_all: no_cleare_all:
; <<< To allocate all >>> ; <<< To allocate all >>>
cmp [number_menu],7 cmp [number_menu],7
jne end_menu ;no_to_allocate_all jne end_menu
mov [OldX],1 mov [crossing_old_x],0
mov [OldY],1 mov [crossing_old_y],0
mov eax,[Picture_SizeX] mov eax,[Picture_SizeX]
mov ebx,[Picture_SizeY] mov ebx,[Picture_SizeY]
dec eax dec eax
dec ebx dec ebx
mov [rectangular_shade_x],eax mov [rectangular_shade_x],eax
mov [rectangular_shade_y],ebx mov [rectangular_shade_y],ebx
mov [instrument_used],1
mov [Activate_instrument],1
mov [Current_instrument],30 mov [Current_instrument],30
mov [crossing],0 mov [crossing],2
; call TakeButtonInstruments
;call MovePictureToWorkScreen ;call MovePictureToWorkScreen
jmp end_menu jmp end_menu
;--------------------------------------------------------------------- ;---------------------------------------------------------------------
;no_to_allocate_all:
no_edit: no_edit:
;|||||||||||||||||||||||||INSTRUMENTS|||||||||||||||||||||| ;|||||||||||||||||||||||||INSTRUMENTS||||||||||||||||||||||
cmp [number_panel],5 cmp [number_panel],5

View File

@ -236,15 +236,15 @@ big_pixel_x:
fps: fps:
;calculate selection rect ;calculate selection rect
cmp [instrument_used],1 cmp [crossing],0
jne .no_selection_rect je .no_selection_rect
mov edx,[rectangular_shade_y] mov edx,[rectangular_shade_y]
sub edx,[PosY] sub edx,[PosY]
mov ecx,[rectangular_shade_x] mov ecx,[rectangular_shade_x]
sub ecx,[PosX] sub ecx,[PosX]
mov ebx,[OldY] mov ebx,[crossing_old_y]
sub ebx,[PosY] sub ebx,[PosY]
mov eax,[OldX] mov eax,[crossing_old_x]
sub eax,[PosX] sub eax,[PosX]
cmp [k],1 cmp [k],1
je .zo_1 je .zo_1