diff options
author | neoraider <devnull@localhost> | 2007-09-26 21:28:04 +0200 |
---|---|---|
committer | neoraider <devnull@localhost> | 2007-09-26 21:28:04 +0200 |
commit | 1e9704dca9a861ffb7b2d3978e1390bea7af7ef0 (patch) | |
tree | 5c6b7cc9486cb48129549f65b969f490fbf01d7a /window.cpp | |
parent | 62e42408485e9e1b7e939925b650a4b2e90ecddb (diff) | |
download | zoomedit-1e9704dca9a861ffb7b2d3978e1390bea7af7ef0.tar zoomedit-1e9704dca9a861ffb7b2d3978e1390bea7af7ef0.zip |
zoomedit: ?berschlagene Polygone werden jetzt korrekt gerendert
Diffstat (limited to 'window.cpp')
-rw-r--r-- | window.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -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); } |