]> git.tdb.fi Git - geometrycompositor.git/commitdiff
Apply some extra distance in case of bulging curvature
authorMikko Rasa <tdb@tdb.fi>
Mon, 14 Dec 2015 22:39:15 +0000 (00:39 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 14 Dec 2015 22:39:15 +0000 (00:39 +0200)
It doesn't work perfectly for spherical curvature, but reasaonably enough
with values that are likely to be of practical use.

source/main.c

index b7bd8a3be92a9b225abe37a74fbd8df2aedf4db9..c6f7c3f01e0cbe62d64a1240cd886047b5a554fd 100644 (file)
@@ -627,6 +627,8 @@ void update_monitor_vertices(CompositedScreen *screen, CompositedMonitor *monito
        sin_ksv = monitor->keystone_vertical/sqrt(1.0f+monitor->keystone_vertical*monitor->keystone_vertical);
        cos_ksv = sqrt(1.0f-sin_ksv*sin_ksv);
        distance = monitor->perspective+sin_ksv*((sin_ksv>0)-monitor->vertical_center)/aspect;
+       if(monitor->curvature_depth<0)
+               distance += -monitor->curvature_depth;
 
        eye[0] = 0.0f;
        eye[1] = (monitor->vertical_center-0.5f)/aspect+sin_ksv*distance;