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
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/include/UI_interface.h1
-rw-r--r--source/blender/editors/interface/interface_draw.c11
-rw-r--r--source/blender/editors/space_api/spacetypes.c4
3 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 574c6d93cbf..11dc88d615d 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -776,6 +776,7 @@ void UI_popup_handlers_remove_all(struct bContext *C, struct ListBase *handlers)
void UI_init(void);
void UI_init_userdef(void);
void UI_reinit_font(void);
+void UI_reinit_gl_state(void);
void UI_exit(void);
/* Layout
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 9d6ae110a32..8fbc545cb77 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -1734,3 +1734,14 @@ void ui_draw_dropshadow(const rctf *rct, float radius, float aspect, float alpha
glDisable(GL_BLEND);
}
+/**
+ * Reset GL state (keep minimal).
+ *
+ * \note Blender's internal code doesn't assume these are reset,
+ * but external callbacks may depend on their state.
+ */
+void UI_reinit_gl_state(void)
+{
+ glLineWidth(1.0f);
+ glPointSize(1.0f);
+}
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index 01f0d1ae54f..590bf5d702e 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -249,8 +249,10 @@ void ED_region_draw_cb_draw(const bContext *C, ARegion *ar, int type)
RegionDrawCB *rdc;
for (rdc = ar->type->drawcalls.first; rdc; rdc = rdc->next) {
- if (rdc->type == type)
+ if (rdc->type == type) {
+ UI_reinit_gl_state();
rdc->draw(C, ar, rdc->customdata);
+ }
}
}