diff options
author | Matt Ebb <matt@mke3.net> | 2010-01-28 10:26:21 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-01-28 10:26:21 +0300 |
commit | 9d0dbd707e2ccac6b11a6be4c19b9413f96cc3c0 (patch) | |
tree | 5bfd0a03e4f608dbb355b24b8ca973d4414df76e /source/blender/editors/interface/interface_draw.c | |
parent | b0989aac023b0c1b9cfc2e7cc1006c62e857275f (diff) |
Fix [#20754] Histogram Not Updating, Showing Incorrect Levels, Colour Management on/off leads to Crash
Various internal fixes, also additional feature - can drag on the histogram to change scale
(0 key to reset).
Also fix [#20844] Color balance node (lift freeze)
Diffstat (limited to 'source/blender/editors/interface/interface_draw.c')
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 5363cf8937c..330209ef6f5 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -690,7 +690,7 @@ static void ui_draw_but_CHARTAB(uiBut *but) #endif -void ui_draw_but_HISTOGRAM(uiBut *but, uiWidgetColors *wcol, rcti *recti) +void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *wcol, rcti *recti) { Histogram *hist = (Histogram *)but->poin; int res = hist->x_resolution; @@ -699,6 +699,7 @@ void ui_draw_but_HISTOGRAM(uiBut *but, uiWidgetColors *wcol, rcti *recti) int rgb; float w, h; float alpha; + GLint scissor[4]; if (hist==NULL) { printf("hist is null \n"); return; } @@ -709,6 +710,7 @@ void ui_draw_but_HISTOGRAM(uiBut *but, uiWidgetColors *wcol, rcti *recti) w = rect.xmax - rect.xmin; h = rect.ymax - rect.ymin; + h *= hist->ymax; glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); @@ -724,6 +726,10 @@ void ui_draw_but_HISTOGRAM(uiBut *but, uiWidgetColors *wcol, rcti *recti) fdrawline(rect.xmin+(i/4.f)*w, rect.ymin, rect.xmin+(i/4.f)*w, rect.ymax); } + /* need scissor test, histogram can draw outside of boundary */ + glGetIntegerv(GL_VIEWPORT, scissor); + glScissor(ar->winrct.xmin + (rect.xmin-1), ar->winrct.ymin+(rect.ymin-1), (rect.xmax+1)-(rect.xmin-1), (rect.ymax+1)-(rect.ymin-1)); + for (rgb=0; rgb<3; rgb++) { float *data; @@ -761,6 +767,9 @@ void ui_draw_but_HISTOGRAM(uiBut *but, uiWidgetColors *wcol, rcti *recti) glDisable(GL_LINE_SMOOTH); } + /* restore scissortest */ + glScissor(scissor[0], scissor[1], scissor[2], scissor[3]); + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glColor4f(0.f, 0.f, 0.f, 0.5f); uiSetRoundBox(15); |