diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2020-05-01 20:29:25 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2020-05-01 20:30:38 +0300 |
commit | 9ca78c9bcc4211abf8a83abd86f457c34e725303 (patch) | |
tree | 23f1fb76428cb51757d49fc57e1d5c1985ff996a | |
parent | eddddceb8e100d7d47a125d4c0dbc8de60c117b3 (diff) |
Fix for T76281: Engine Info Overlay Formatting
Allow render engine info to display correctly among other text overlays and scene statistics.
Differential Revision: https://developer.blender.org/D7586
Reviewed by Brecht Van Lommel
-rw-r--r-- | source/blender/draw/DRW_engine.h | 2 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/draw/DRW_engine.h b/source/blender/draw/DRW_engine.h index 1bdc3bc5a03..6e7654aed02 100644 --- a/source/blender/draw/DRW_engine.h +++ b/source/blender/draw/DRW_engine.h @@ -77,7 +77,7 @@ typedef bool (*DRW_SelectPassFn)(eDRWSelectStage stage, void *user_data); typedef bool (*DRW_ObjectFilterFn)(struct Object *ob, void *user_data); void DRW_draw_view(const struct bContext *C); -void DRW_draw_region_engine_info(int xoffset, int yoffset); +void DRW_draw_region_engine_info(int xoffset, int *yoffset, int line_height); void DRW_draw_render_loop_ex(struct Depsgraph *depsgraph, struct RenderEngineType *engine_type, diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 28c8570e897..e3c364eef6d 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1068,7 +1068,7 @@ static void drw_engines_draw_text(void) } /* Draw render engine info. */ -void DRW_draw_region_engine_info(int xoffset, int yoffset) +void DRW_draw_region_engine_info(int xoffset, int *yoffset, int line_height) { LISTBASE_FOREACH (LinkData *, link, &DST.enabled_engines) { DrawEngineType *engine = link->data; @@ -1091,8 +1091,8 @@ void DRW_draw_region_engine_info(int xoffset, int yoffset) if (*chr_current == '\n') { char info[GPU_INFO_SIZE]; BLI_strncpy(info, chr_start, line_len + 1); - yoffset -= U.widget_unit; - BLF_draw_default(xoffset, yoffset, 0.0f, info, sizeof(info)); + *yoffset -= line_height; + BLF_draw_default(xoffset, *yoffset, 0.0f, info, sizeof(info)); /* Re-start counting. */ chr_start = chr_current + 1; @@ -1102,8 +1102,8 @@ void DRW_draw_region_engine_info(int xoffset, int yoffset) char info[GPU_INFO_SIZE]; BLI_strncpy(info, chr_start, line_len + 1); - yoffset -= U.widget_unit; - BLF_draw_default(xoffset, yoffset, 0.0f, info, sizeof(info)); + *yoffset -= line_height; + BLF_draw_default(xoffset, *yoffset, 0.0f, info, sizeof(info)); BLF_disable(font_id, BLF_SHADOW); } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 6977345c48a..fac378ae104 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1576,7 +1576,7 @@ void view3d_draw_region_info(const bContext *C, ARegion *region) draw_grid_unit_name(scene, rv3d, v3d, xoffset, &yoffset); } - DRW_draw_region_engine_info(xoffset, yoffset); + DRW_draw_region_engine_info(xoffset, &yoffset, VIEW3D_OVERLAY_LINEHEIGHT); } if ((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0 && (v3d->overlay.flag & V3D_OVERLAY_STATS)) { |