aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/main.c b/main.c
index 649be92..3d5d8b5 100644
--- a/main.c
+++ b/main.c
@@ -8,18 +8,12 @@
#include "dat.h"
#include "fns.h"
-/* palette colors */
-enum {
- PCBlack,
- PCWhite,
- NCOLOR
-};
-
RFrame worldrf;
-Image *pal[NCOLOR];
Image *background;
Canvas *curcanvas;
Image *brushcolor;
+Image *pal[NCOLOR];
+int zoom = 1;
void resized(void);
@@ -252,8 +246,7 @@ lmb(Mousectl *mc, Keyboardctl *)
p = Pt(mpos.x,mpos.y);
if(eqpt(p, oldp))
continue;
- //draw(curcanvas->curlayer->image, rectaddpt(r, p), brushcolor, nil, ZP);
- line(curcanvas->curlayer->image, oldp, p, Enddisc, Enddisc, 0, brushcolor, ZP);
+ line(curcanvas->curlayer->image, oldp, p, Endsquare, Endsquare, 0, brushcolor, ZP);
redraw();
}
}
@@ -267,6 +260,10 @@ mouse(Mousectl *mc, Keyboardctl *kc)
mmb(mc, kc);
if((mc->buttons&4) != 0)
rmb(mc, kc);
+ if((mc->buttons&8) != 0)
+ zoom = clamp(++zoom, 0, MAXZOOM);
+ if((mc->buttons&16) != 0)
+ zoom = clamp(--zoom, 0, MAXZOOM);
}
void
@@ -276,6 +273,12 @@ key(Rune r)
case Kdel:
case 'q':
threadexitsall(nil);
+ case '+':
+ zoom = clamp(++zoom, 0, MAXZOOM);
+ break;
+ case '-':
+ zoom = clamp(--zoom, 0, MAXZOOM);
+ break;
}
}