Brush size and canvas

This commit is contained in:
visionmercer 2026-05-11 10:40:49 +02:00
commit b978f2e8cf

View file

@ -43,9 +43,9 @@ layers(2).ihandle=_newimage(320,320,32)
layers(3).ihandle=_newimage(320,320,32) layers(3).ihandle=_newimage(320,320,32)
_dest layers(0).ihandle _dest layers(0).ihandle
addcommand "canvas ("+str$(_width)+","+str$(_height)+")"
line (0,0)-(_width-1,_height-1),_rgb32(255),bf line (0,0)-(_width-1,_height-1),_rgb32(255),bf
_dest 0 _dest 0
state.tool = 1 state.tool = 1
state.zoom = 1.0 state.zoom = 1.0
state.offsetX = 70 + 20 state.offsetX = 70 + 20
@ -129,8 +129,10 @@ canvas
select case keyin select case keyin
case "+" case "+"
state.brushsize=state.brushsize+1 state.brushsize=state.brushsize+1
addcommand "brushsize ("+str$(state.brushsize)+")"
case "-" case "-"
if state.brushsize>1 then state.brushsize=state.brushsize-1 if state.brushsize>1 then state.brushsize=state.brushsize-1
addcommand "brushsize ("+str$(state.brushsize)+")"
case chr$(19) ' ctrl+s case chr$(19) ' ctrl+s
'TODO: save logic 'TODO: save logic
case chr$(27)' esc case chr$(27)' esc
@ -377,8 +379,6 @@ sub canvas
thickline state.startX, state.startY, canX, canY, drawCol thickline state.startX, state.startY, canX, canY, drawCol
addcommand "line ("+str$(state.startX)+","+str$(state.startY)+","+str$(canX)+","+str$(canY)+","+hex$(drawCol)+")" addcommand "line ("+str$(state.startX)+","+str$(state.startY)+","+str$(canX)+","+str$(canY)+","+hex$(drawCol)+")"
end if end if
'thickline state.startX, state.startY, canX, canY, drawCol
'addcommand "line ("+str$(state.startX)+","+ str$(state.startY)+","+str$(canX)+","+str$(canY)+","+hex$(drawCol)+")"
state.startX = canX: state.startY = canY state.startX = canX: state.startY = canY
case 2 ' Straight Line case 2 ' Straight Line
thickline state.startX, state.startY, canX, canY, drawCol thickline state.startX, state.startY, canX, canY, drawCol