]> git.sesse.net Git - nageru/blobdiff - theme.lua
Fix some broken culling code in the theme (no idea why this does not trigger more...
[nageru] / theme.lua
index bbc086a4e86f478dde7c2b66eabe8f64e78a0aee..7f47c8491341879c350dd7babe489163ce56a19b 100644 (file)
--- a/theme.lua
+++ b/theme.lua
@@ -697,10 +697,15 @@ function place_rectangle(resample_effect, resize_effect, padding_effect, x0, y0,
 
        -- Cull.
        if x0 > screen_width or x1 < 0.0 or y0 > screen_height or y1 < 0.0 then
-               resample_effect:set_int("width", 1)
-               resample_effect:set_int("height", 1)
-               resample_effect:set_float("zoom_x", screen_width)
-               resample_effect:set_float("zoom_y", screen_height)
+               if resample_effect ~= nil then
+                       resample_effect:set_int("width", 1)
+                       resample_effect:set_int("height", 1)
+                       resample_effect:set_float("zoom_x", screen_width)
+                       resample_effect:set_float("zoom_y", screen_height)
+               else
+                       resize_effect:set_int("width", 1)
+                       resize_effect:set_int("height", 1)
+               end
                padding_effect:set_int("left", screen_width + 100)
                padding_effect:set_int("top", screen_height + 100)
                return
@@ -854,9 +859,9 @@ end
 function calc_fade_progress(t, transition_start, transition_end)
        local tt = (t - transition_start) / (transition_end - transition_start)
        if tt < 0.0 then
-               tt = 0.0
+               return 0.0
        elseif tt > 1.0 then
-               tt = 1.0
+               return 1.0
        end
 
        -- Make the fade look maybe a tad more natural, by pumping it