UI: Fix incorrect offset for panel label when zooming in

The panel title text intersected any buttons in the header because
the label offset retrieved from the layout code was not scaled by
the block's zoom level. Error in rB0d93bd8d63980.
This commit is contained in:
Hans Goudey 2020-11-26 10:29:03 -05:00
parent 44f5d99cbf
commit 4705fafa7e
1 changed files with 1 additions and 1 deletions

View File

@ -1108,7 +1108,7 @@ static void panel_draw_aligned_widgets(const uiStyle *style,
if (panel->drawname[0] != '\0') {
/* + 0.001f to avoid flirting with float inaccuracy .*/
const rcti title_rect = {
.xmin = widget_rect.xmin + panel->labelofs + scaled_unit * 1.1f,
.xmin = widget_rect.xmin + (panel->labelofs / aspect) + scaled_unit * 1.1f,
.xmax = widget_rect.xmax,
.ymin = widget_rect.ymin - 2.0f / aspect,
.ymax = widget_rect.ymax,