~rabbits/nasu

29b0b84341fc11f00c55466a6e758f83b6f37d0f — neauoire 1 year, 7 months ago 748b3de
Added copy/paste
1 files changed, 27 insertions(+), 18 deletions(-)

M src/main.tal
M src/main.tal => src/main.tal +27 -18
@@ 250,8 250,8 @@ BRK
	DUP [ LIT 'a ] ! ,&no-expand JCN
		#00 .selection/x1 STZ
		#00 .selection/y1 STZ
		HOR .selection/x2 STZ
		VER .selection/y2 STZ
		HOR #01 - .selection/x2 STZ
		VER #01 - .selection/y2 STZ
		;clamp-selection JSR2
		;redraw JSR2 POP BRK 
		&no-expand


@@ 350,6 350,8 @@ BRK

@on-touch-tileview ( -> )
	
	.settings/zoom LDZ #01 = ;&zoomed JCN2

	.settings/tool LDZ #01 = ;&select JCN2

	( skip ) .Mouse/state DEI #00 ! #01 JCN [ BRK ]


@@ 357,17 359,6 @@ BRK
	.Mouse/x DEI2 .tileview/x1 LDZ2 -- 
	.Mouse/y DEI2 .tileview/y1 LDZ2 -- 

	.settings/zoom LDZ #01 ! ,&no-zoom JCN
		#0008 // SWP2 #0008 // SWP2
		GET-POSITION ADD-POSITIONS
		#00 .Mouse/state DEI #10 = ,&do-erase-zoom JCN 
			POP .settings/color LDZ &do-erase-zoom 
			;put-pixel JSR2
			SET-STATE
			;redraw JSR2
		BRK
	&no-zoom

	.settings/tool LDZ .Mouse/state DEI
	DUP2 #0001 !! ,&no-brush-mouse1 JCN ( brush default )
		POP2


@@ 407,7 398,9 @@ BRK
					DUP .selection/x1 STZ .selection/x2 STZ
				.Mouse/y DEI2 .tileview/y1 LDZ2 -- 8// TOB 
					DUP .selection/y1 STZ .selection/y2 STZ
				;clamp-selection JSR2 ;redraw JSR2
				;clamp-selection JSR2 
				.selection LDZ2 GET-ADDR .settings/focus STZ2
				;redraw JSR2
				,&end JMP 
				&no-down
			( release )


@@ 420,6 413,21 @@ BRK

	BRK

	&zoomed ( -> )

		( skip ) .Mouse/state DEI #00 ! #01 JCN [ BRK ]

		.Mouse/x DEI2 .tileview/x1 LDZ2 -- 
		.Mouse/y DEI2 .tileview/y1 LDZ2 -- 
		#0008 // SWP2 #0008 // SWP2
		GET-POSITION ADD-POSITIONS
		#00 .Mouse/state DEI #10 = ,&do-erase-zoom JCN 
			POP .settings/color LDZ 
			&do-erase-zoom 
		;put-pixel JSR2
		SET-STATE
		;redraw JSR2

BRK

@on-touch-toolview ( -> )


@@ 1282,10 1290,11 @@ RTN
	( stash x,y ) .selection LDZ2 STH2
	.File/success DEI2 #0000
	&loop
		DUP2 
			DATA-CLIP ++ 
			STH2kr GET-ADDR
			;copy-tile JSR2
		( limit at selection )
		OVRr STHr .selection/x2 LDZ #01 + LTH ,&linebreak JCN
			STH2r #01 + SWP POP .selection/x1 LDZ SWP STH2
			&linebreak
		DUP2 [ DATA-CLIP ++ ] [ STH2kr GET-ADDR ] ;copy-tile JSR2
		( move-x ) SWPr LITr 01 ADDr SWPr
		&resume
		#0010 ++ GTH2k ,&loop JCN