Screen: Fix screen layout preview render.

This commit is contained in:
Clément Foucault
2018-03-03 18:06:19 +01:00
parent a6e6d7e022
commit b7414d357a

View File

@@ -485,6 +485,7 @@ static void screen_preview_draw(const bScreen *screen, int size_x, int size_y)
wmOrtho2(0.0f, size_x, 0.0f, size_y);
/* center */
gpuPushMatrix();
gpuLoadIdentity();
gpuTranslate2f(size_x * (1.0f - asp[0]) * 0.5f, size_y * (1.0f - asp[1]) * 0.5f);
screen_preview_scale_get(screen, size_x, size_y, asp, scale);
@@ -503,7 +504,7 @@ void ED_screen_preview_render(const bScreen *screen, int size_x, int size_y, uns
GPU_offscreen_bind(offscreen, true);
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
screen_preview_draw(screen, size_x, size_y);