diff --git a/src/widgets/ruler.cpp b/src/widgets/ruler.cpp
index bd3ec28eb767b5ad7b51a259b9ff2014892245c5..c4ff1746c03a1db39c535871d5a7e6440fc6d329 100644 (file)
--- a/src/widgets/ruler.cpp
+++ b/src/widgets/ruler.cpp
*/
#include <cmath>
+#include <cstdio>
#include <string.h>
#include "widget-sizes.h"
#include "ruler.h"
ruler = GTK_RULER (widget);
- if (event->is_hint)
- gdk_window_get_pointer (widget->window, &x, NULL, NULL);
- else
- x = (int)event->x;
+ x = (int)event->x;
ruler->position = ruler->lower + ((ruler->upper - ruler->lower) * x) / widget->allocation.width;
ruler = GTK_RULER (widget);
- if (event->is_hint)
- gdk_window_get_pointer (widget->window, NULL, &y, NULL);
- else
- y = (int)event->y;
+ y = (int)event->y;
ruler->position = ruler->lower + ((ruler->upper - ruler->lower) * y) / widget->allocation.height;