From 89598f3b919444aa399eb47736f04e2c062c856a Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 12 Dec 2015 19:07:18 +0200 Subject: [PATCH] Invert the Y coordinate for monitors as well --- source/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/main.c b/source/main.c index 1aee407..5393784 100644 --- a/source/main.c +++ b/source/main.c @@ -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); -- 2.45.2