]> git.tdb.fi Git - geometrycompositor.git/commitdiff
Invert the Y coordinate for monitors as well
authorMikko Rasa <tdb@tdb.fi>
Sat, 12 Dec 2015 17:07:18 +0000 (19:07 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 12 Dec 2015 17:07:18 +0000 (19:07 +0200)
source/main.c

index 1aee407328a73fe924cd49626662a0fe6c60eaa9..539378465600ae409bdb1d709545909ec465af9c 100644 (file)
@@ -489,7 +489,7 @@ void update_monitor_vertices(CompositedScreen *screen, CompositedMonitor *monito
 
                        v = vertex_data+(y*(t+1)+x)*4;
                        v[2] = (monitor->x+xf*monitor->width)/screen->width;
-                       v[3] = (monitor->y+yf*monitor->height)/screen->height;
+                       v[3] = ((float)screen->height-monitor->y-monitor->height+yf*monitor->height)/screen->height;
 
                        z = sqrt(0.25f-(xf-0.5f)*(xf-0.5f)*4.0f*cyl_w_sq)-0.5f+monitor->cylinder_depth;
                        if(monitor->keystone_vertical>0)
@@ -1066,7 +1066,7 @@ void refresh_screen(Compositor *compositor, CompositedScreen *screen)
                        continue;
 
                glUniform4f(screen->geometry_loc,
-                       (float)monitor->x/screen->width, (float)monitor->y/screen->height,
+                       (float)monitor->x/screen->width, ((float)screen->height-monitor->y-monitor->height)/screen->height,
                        (float)monitor->width/screen->width, (float)monitor->height/screen->height);
 
                glBindVertexArray(monitor->vertex_array);