Better toolbox handling.
This commit is contained in:
parent
1a473a6972
commit
b5cac2ac8d
1 changed files with 14 additions and 2 deletions
14
pixler.bas
14
pixler.bas
|
|
@ -70,7 +70,6 @@ do
|
||||||
oldHeight = _height
|
oldHeight = _height
|
||||||
end if
|
end if
|
||||||
|
|
||||||
cls
|
|
||||||
line (0,0)-(_width-1,_height-1),backgroundcolor1,bf
|
line (0,0)-(_width-1,_height-1),backgroundcolor1,bf
|
||||||
|
|
||||||
'Mouse Handling
|
'Mouse Handling
|
||||||
|
|
@ -182,6 +181,7 @@ sub colorpicker
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
sub canvas
|
sub canvas
|
||||||
|
|
||||||
' 1. Define the Viewport (The "Window" on your screen)
|
' 1. Define the Viewport (The "Window" on your screen)
|
||||||
dim viewX1 as integer
|
dim viewX1 as integer
|
||||||
if showtoolbox then viewX1 = 70 else viewX1 = 0
|
if showtoolbox then viewX1 = 70 else viewX1 = 0
|
||||||
|
|
@ -237,6 +237,18 @@ sub canvas
|
||||||
end if
|
end if
|
||||||
next
|
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
|
' 3. Calculate Canvas Coordinates
|
||||||
dim canX as integer: canX = int((_mousex - state.offsetX) / state.zoom)
|
dim canX as integer: canX = int((_mousex - state.offsetX) / state.zoom)
|
||||||
dim canY as integer: canY = int((_mousey - state.offsetY) / state.zoom)
|
dim canY as integer: canY = int((_mousey - state.offsetY) / state.zoom)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue