Add grid lines
[ipdf/code.git] / src / main.h
index c7d5eca..63c68b3 100644 (file)
@@ -12,7 +12,7 @@ inline void MainLoop(Document & doc)
 {
        View view(doc);
        Screen scr;
-       scr.SetMouseHandler([&](int x, int y, int buttons, int wheel)
+       scr.SetMouseHandler([&](int x, int y, int buttons, int wheel) // [?] wtf
        {
                static bool oldButtonDown = false;
                static int oldx, oldy;
@@ -35,8 +35,14 @@ inline void MainLoop(Document & doc)
                }
                oldx = x;
                oldy = y;
+               
+               if (wheel)
+               {
+                       view.ScaleAroundPoint(Real(x)/Real(scr.ViewportWidth()),Real(y)/Real(scr.ViewportHeight()), expf(-wheel/20.f));
+               }
        }
        );
+
        while (scr.PumpEvents())
        {
                view.Render();

UCC git Repository :: git.ucc.asn.au