Better toolbox handling.
This commit is contained in:
parent
1a473a6972
commit
b5cac2ac8d
1 changed files with 14 additions and 2 deletions
16
pixler.bas
16
pixler.bas
|
|
@ -70,7 +70,6 @@ do
|
|||
oldHeight = _height
|
||||
end if
|
||||
|
||||
cls
|
||||
line (0,0)-(_width-1,_height-1),backgroundcolor1,bf
|
||||
|
||||
'Mouse Handling
|
||||
|
|
@ -182,6 +181,7 @@ sub colorpicker
|
|||
end sub
|
||||
|
||||
sub canvas
|
||||
|
||||
' 1. Define the Viewport (The "Window" on your screen)
|
||||
dim viewX1 as integer
|
||||
if showtoolbox then viewX1 = 70 else viewX1 = 0
|
||||
|
|
@ -236,7 +236,19 @@ sub canvas
|
|||
_putimage (drawX1, drawY1)-(drawX2, drawY2), img, 0, (srcX1, srcY1)-(srcX2, srcY2)
|
||||
end if
|
||||
next
|
||||
|
||||
|
||||
' 2.5 if the mouse is in ui thats all we need
|
||||
if showtoolbox then
|
||||
if _mousex >= 0 and _mousex <= 70 then
|
||||
exit sub
|
||||
end if
|
||||
end if
|
||||
if showcolorpicker then
|
||||
if _mousey >= _height - 20 then
|
||||
exit sub
|
||||
end if
|
||||
end if
|
||||
|
||||
' 3. Calculate Canvas Coordinates
|
||||
dim canX as integer: canX = int((_mousex - state.offsetX) / state.zoom)
|
||||
dim canY as integer: canY = int((_mousey - state.offsetY) / state.zoom)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue