From b5cac2ac8d59402e0bf263776b20a9490abbe78d Mon Sep 17 00:00:00 2001 From: visionmercer <62051836+visionmercer@users.noreply.github.com> Date: Mon, 4 May 2026 12:30:34 +0200 Subject: [PATCH] Better toolbox handling. --- pixler.bas | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pixler.bas b/pixler.bas index 22580d2..f048983 100644 --- a/pixler.bas +++ b/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)