Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Erwin <significant.bit@gmail.com>2017-03-30 10:01:50 +0300
committerMike Erwin <significant.bit@gmail.com>2017-03-30 10:01:50 +0300
commit10b27bd30ab8193305b064941c827dd2cda9eeb1 (patch)
treea6ac010e734ca9d65243d2ca5464ed9684593a35 /source/blender/editors/screen
parent126ee42a304202743f3b349f2103ba2658426e35 (diff)
fix screen layout thumbnails (T51078)
GPU_framebuffer no longer handles transform matrices, which this code was relying on. Made screen_preview_draw responsible for its own ModelView matrix.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r--source/blender/editors/screen/screen_draw.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/screen/screen_draw.c b/source/blender/editors/screen/screen_draw.c
index 22c6f070ac9..bbcf4eb56a2 100644
--- a/source/blender/editors/screen/screen_draw.c
+++ b/source/blender/editors/screen/screen_draw.c
@@ -433,16 +433,17 @@ static void screen_preview_draw_areas(const bScreen *screen, const float scale[2
{
const float ofs_h = ofs_between_areas * 0.5f;
unsigned int pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 2, KEEP_FLOAT);
- rctf rect;
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor4fv(col);
for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
- rect.xmin = sa->totrct.xmin * scale[0] + ofs_h;
- rect.xmax = sa->totrct.xmax * scale[0] - ofs_h;
- rect.ymin = sa->totrct.ymin * scale[1] + ofs_h;
- rect.ymax = sa->totrct.ymax * scale[1] - ofs_h;
+ rctf rect = {
+ .xmin = sa->totrct.xmin * scale[0] + ofs_h,
+ .xmax = sa->totrct.xmax * scale[0] - ofs_h,
+ .ymin = sa->totrct.ymin * scale[1] + ofs_h,
+ .ymax = sa->totrct.ymax * scale[1] - ofs_h
+ };
immBegin(PRIM_TRIANGLE_FAN, 4);
immVertex2f(pos, rect.xmin, rect.ymin);
@@ -464,10 +465,13 @@ 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();
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);
screen_preview_draw_areas(screen, scale, col, 1.5f);
+
+ gpuPopMatrix();
}
/**