UI: Fix Unreported missing background for azone arrow
This was caused by the sRGB viewport changes. The fix is to modify the alpha values manually. The shader was also missing a srgb fix.
This commit is contained in:
parent
0909b564a9
commit
ada03e8673
|
@ -269,7 +269,7 @@ static void draw_azone_arrow(float x1, float y1, float x2, float y2, AZEdge edge
|
|||
GPU_blend(false);
|
||||
}
|
||||
|
||||
static void region_draw_azone_tab_arrow(AZone *az)
|
||||
static void region_draw_azone_tab_arrow(ScrArea *area, ARegion *region, AZone *az)
|
||||
{
|
||||
GPU_blend(true);
|
||||
|
||||
|
@ -289,7 +289,9 @@ static void region_draw_azone_tab_arrow(AZone *az)
|
|||
break;
|
||||
}
|
||||
|
||||
float color[4] = {0.05f, 0.05f, 0.05f, 0.4f};
|
||||
/* Workaround for different color spaces between normal areas and the ones using GPUViewports. */
|
||||
float alpha = WM_region_use_viewport(area, region) ? 0.6f : 0.4f;
|
||||
float color[4] = {0.05f, 0.05f, 0.05f, alpha};
|
||||
UI_draw_roundbox_aa(
|
||||
true, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, color);
|
||||
|
||||
|
@ -330,7 +332,7 @@ static void region_draw_azones(ScrArea *area, ARegion *region)
|
|||
if (az->region) {
|
||||
/* only display tab or icons when the region is hidden */
|
||||
if (az->region->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) {
|
||||
region_draw_azone_tab_arrow(az);
|
||||
region_draw_azone_tab_arrow(area, region, az);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,4 +35,6 @@ void main()
|
|||
if (butCo > 0.0) {
|
||||
fragColor.a = 1.0;
|
||||
}
|
||||
|
||||
fragColor = blender_srgb_to_framebuffer_space(fragColor);
|
||||
}
|
||||
|
|
|
@ -870,6 +870,8 @@ void WM_generic_callback_free(struct wmGenericCallback *callback);
|
|||
|
||||
void WM_generic_user_data_free(struct wmGenericUserData *user_data);
|
||||
|
||||
bool WM_region_use_viewport(struct ScrArea *area, struct ARegion *region);
|
||||
|
||||
#ifdef WITH_XR_OPENXR
|
||||
/* wm_xr.c */
|
||||
bool WM_xr_session_exists(const wmXrData *xr);
|
||||
|
|
|
@ -293,7 +293,7 @@ static bool wm_region_use_viewport_by_type(short space_type, short region_type)
|
|||
return (ELEM(space_type, SPACE_VIEW3D, SPACE_IMAGE) && region_type == RGN_TYPE_WINDOW);
|
||||
}
|
||||
|
||||
static bool wm_region_use_viewport(ScrArea *area, ARegion *region)
|
||||
bool WM_region_use_viewport(ScrArea *area, ARegion *region)
|
||||
{
|
||||
return wm_region_use_viewport_by_type(area->spacetype, region->regiontype);
|
||||
}
|
||||
|
@ -658,7 +658,7 @@ static void wm_draw_window_offscreen(bContext *C, wmWindow *win, bool stereo)
|
|||
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
|
||||
if (region->visible && region->do_draw) {
|
||||
CTX_wm_region_set(C, region);
|
||||
bool use_viewport = wm_region_use_viewport(area, region);
|
||||
bool use_viewport = WM_region_use_viewport(area, region);
|
||||
|
||||
if (stereo && wm_draw_region_stereo_set(bmain, area, region, STEREO_LEFT_ID)) {
|
||||
wm_draw_region_buffer_create(region, true, use_viewport);
|
||||
|
@ -1042,7 +1042,7 @@ void WM_draw_region_free(ARegion *region, bool hide)
|
|||
void wm_draw_region_test(bContext *C, ScrArea *area, ARegion *region)
|
||||
{
|
||||
/* Function for redraw timer benchmark. */
|
||||
bool use_viewport = wm_region_use_viewport(area, region);
|
||||
bool use_viewport = WM_region_use_viewport(area, region);
|
||||
wm_draw_region_buffer_create(region, false, use_viewport);
|
||||
wm_draw_region_bind(region, 0);
|
||||
ED_region_do_draw(C, region);
|
||||
|
|
Loading…
Reference in New Issue