diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-05-14 14:03:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-05-14 14:29:17 +0300 |
commit | 5205a0f671a96c548a0c9832e00e7746e5153fb8 (patch) | |
tree | a5b4ff9c83620d9e0b215b9e8b98f790defc793a /source/blender/editors/manipulator_library | |
parent | b942106c738b3981cd728c625a12bdfce0ae0bd1 (diff) |
Fix incorrect matrix stack push/pop
Diffstat (limited to 'source/blender/editors/manipulator_library')
-rw-r--r-- | source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c index a6964359595..73520d1801d 100644 --- a/source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c +++ b/source/blender/editors/manipulator_library/manipulator_types/button2d_manipulator.c @@ -127,12 +127,12 @@ static void button2d_draw_intern( manipulator_color_get(mpr, highlight, color); WM_manipulator_calc_matrix_final(mpr, matrix_final); + bool need_to_pop = true; gpuPushMatrix(); gpuMultMatrix(matrix_final); - glEnable(GL_BLEND); - if (select == false) { + glEnable(GL_BLEND); if (button->shape_batch[0] != NULL) { glEnable(GL_LINE_SMOOTH); glLineWidth(1.0f); @@ -147,21 +147,22 @@ static void button2d_draw_intern( GWN_batch_draw(button->shape_batch[i]); } glDisable(GL_LINE_SMOOTH); - gpuPopMatrix(); } else if (button->icon != ICON_NONE) { button2d_geom_draw_backdrop(mpr, color, select); gpuPopMatrix(); + need_to_pop = false; UI_icon_draw( mpr->matrix_basis[3][0] - (ICON_DEFAULT_WIDTH / 2.0) * UI_DPI_FAC, mpr->matrix_basis[3][1] - (ICON_DEFAULT_HEIGHT / 2.0) * UI_DPI_FAC, button->icon); } - else { - gpuPopMatrix(); - } + glDisable(GL_BLEND); + } + + if (need_to_pop) { + gpuPopMatrix(); } - glDisable(GL_BLEND); } static void manipulator_button2d_draw_select(const bContext *C, wmManipulator *mpr, int select_id) |