summaryrefslogtreecommitdiffstats
path: root/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'window.cpp')
-rw-r--r--window.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/window.cpp b/window.cpp
index ff570ce..881a96f 100644
--- a/window.cpp
+++ b/window.cpp
@@ -27,7 +27,7 @@ static void refreshScrolling() {
gtk_widget_queue_draw(drawingArea);
}
-static void updateScrollbars(double x, double y) {
+static void updateScrollbars(float x, float y) {
const gdouble imageWidth = getImageWidth(), imageHeight = getImageHeight();
const gdouble width = drawingArea->allocation.width, height = drawingArea->allocation.height;
gdouble upper, pageSize, value;
@@ -83,8 +83,8 @@ static void realize(GtkWidget *widget, gpointer data) {
glLoadIdentity();
if(widget->allocation.width != 0 && widget->allocation.height != 0) {
- glTranslated(-1, 1, 0);
- glScaled(2.0/widget->allocation.width, -2.0/widget->allocation.height, 1);
+ glTranslatef(-1, 1, 0);
+ glScalef(2.0f/widget->allocation.width, -2.0f/widget->allocation.height, 1);
}
glMatrixMode(GL_MODELVIEW);
@@ -106,8 +106,8 @@ static gboolean configureEvent(GtkWidget *widget, GdkEventConfigure *event, gpoi
glLoadIdentity();
if(widget->allocation.width != 0 && widget->allocation.height != 0) {
- glTranslated(-1, 1, 0);
- glScaled(2.0/widget->allocation.width, -2.0/widget->allocation.height, 1);
+ glTranslatef(-1, 1, 0);
+ glScalef(2.0f/widget->allocation.width, -2.0f/widget->allocation.height, 1);
}
gdk_gl_drawable_gl_end(drawable);
@@ -119,14 +119,14 @@ static gboolean configureEvent(GtkWidget *widget, GdkEventConfigure *event, gpoi
static gboolean scrollEvent(GtkWidget *widget, GdkEventScroll *event, gpointer user_data) {
- const gdouble x = event->x/widget->allocation.width, y = event->y/widget->allocation.height;
+ const float x = event->x/widget->allocation.width, y = event->y/widget->allocation.height;
switch(event->direction) {
case GDK_SCROLL_UP:
- zoomIn(1.1, x, y);
+ zoomIn(1.1f, x, y);
break;
case GDK_SCROLL_DOWN:
- zoomOut(1.1, x, y);
+ zoomOut(1.1f, x, y);
}
}
@@ -389,20 +389,20 @@ void updateSidebar() {
}
}
-void zoomIn(double factor, double x, double y) {
+void zoomIn(float factor, float x, float y) {
setScale(getScale()*factor);
updateScrollbars(x, y);
}
-void zoomOut(double factor, double x, double y) {
+void zoomOut(float factor, float x, float y) {
setScale(getScale()/factor);
updateScrollbars(x, y);
}
-void zoomInCentered(double factor) {
+void zoomInCentered(float factor) {
zoomIn(factor, 0.5, 0.5);
}
-void zoomOutCentered(double factor) {
+void zoomOutCentered(float factor) {
zoomOut(factor, 0.5, 0.5);
}