Fix T82164: Knife tool draws huge vertices after using bgl.glPointSize

Since it is possible to have multiple draw callbacks, (some of which
use bgl and others gpu), check and force the reset of the drawing status
at the end of each callback.

Differential Revision: https://developer.blender.org/D9476
This commit is contained in:
Germano Cavalcante 2020-11-05 17:14:09 -03:00
parent 69e567cfe8
commit 1b9d9cb1ed
Notes: blender-bot 2023-02-14 05:01:20 +01:00
Referenced by issue #82164, Knife tool draws huge vertices (it draws verts with glPointSize is not initialized)
1 changed files with 3 additions and 5 deletions

View File

@ -276,13 +276,11 @@ void ED_region_draw_cb_draw(const bContext *C, ARegion *region, int type)
for (rdc = region->type->drawcalls.first; rdc; rdc = rdc->next) {
if (rdc->type == type) {
rdc->draw(C, region, rdc->customdata);
has_drawn_something = true;
/* This is needed until we get rid of BGL which can change the states we are tracking. */
GPU_bgl_end();
}
}
if (has_drawn_something) {
/* This is needed until we get rid of BGL which can change the states we are tracking. */
GPU_bgl_end();
}
}
/* ********************* space template *********************** */