git.ucc.asn.au
/
ipdf
/
code.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Add grid lines
[ipdf/code.git]
/
src
/
main.h
diff --git
a/src/main.h
b/src/main.h
index
c7d5eca
..
63c68b3
100644
(file)
--- a/
src/main.h
+++ b/
src/main.h
@@
-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