]> git.tdb.fi Git - geometrycompositor.git/commitdiff
Simplify some formulas a bit
authorMikko Rasa <tdb@tdb.fi>
Sun, 13 Dec 2015 12:12:44 +0000 (14:12 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 13 Dec 2015 12:15:24 +0000 (14:15 +0200)
source/main.c

index 08be9dda8e8f8224f384939342fa07db2cc48ec5..1cabcf637dc992dd14dcf71656795e371e218c5a 100644 (file)
@@ -1072,7 +1072,7 @@ void refresh_screen(Compositor *compositor, CompositedScreen *screen)
                glBindTexture(GL_TEXTURE_2D, window->texture);
                compositor->glXBindTexImageEXT(compositor->display, window->glx_pixmap, GLX_FRONT_LEFT_EXT, NULL);
                glUniform4f(screen->geometry_loc,
-                       (float)window->x/screen->width, ((float)screen->height-window->y-window->height)/screen->height,
+                       (float)window->x/screen->width, 1.0f-(float)(window->y+window->height)/screen->height,
                        (float)(window->width+2*window->border)/screen->width, (float)(window->height+2*window->border)/screen->height);
                glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
                compositor->glXReleaseTexImageEXT(compositor->display, window->glx_pixmap, GLX_FRONT_LEFT_EXT);
@@ -1093,7 +1093,7 @@ void refresh_screen(Compositor *compositor, CompositedScreen *screen)
                        continue;
 
                glUniform4f(screen->geometry_loc,
-                       (float)monitor->x/screen->width, ((float)screen->height-monitor->y-monitor->height)/screen->height,
+                       (float)monitor->x/screen->width, 1.0f-(float)(monitor->y+monitor->height)/screen->height,
                        (float)monitor->width/screen->width, (float)monitor->height/screen->height);
 
                glBindVertexArray(monitor->vertex_array);