mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
UI: Fix Vertical Jiggling of Category Tabs at Some Sizes
At some sizes (combination of Resolution Scale and local 2D scale) the movement of sidebar regions can show their category tabs jiggling up and down. This looks like the first tab moving up and down a single pixel, the second tab moving by two, the third by three, etc. This is because the calculation of the local "aspect" is using the block aspect which can vary by a small amount and so at some sizes this difference can straddle a pixel. This PR directly calculates the local aspect based on the region sizes, which results in a stable value and therefore fixes this glitch. Pull Request: https://projects.blender.org/blender/blender/pulls/155729
This commit is contained in:
parent
df938d69e2
commit
d2fe1d4302
1 changed files with 2 additions and 3 deletions
|
|
@ -1429,9 +1429,8 @@ void panel_category_tabs_draw_all(ARegion *region, const char *category_id_activ
|
|||
fontstyle_set(fstyle);
|
||||
const int fontid = fstyle->uifont_id;
|
||||
float fstyle_points = fstyle->points;
|
||||
const float aspect = BLI_listbase_is_empty(®ion->runtime->uiblocks) ?
|
||||
1.0f :
|
||||
(static_cast<Block *>(region->runtime->uiblocks.first))->aspect;
|
||||
const float aspect = BLI_rctf_size_y(®ion->v2d.cur) /
|
||||
(BLI_rcti_size_y(®ion->v2d.mask) + 1);
|
||||
const float zoom = 1.0f / aspect;
|
||||
const int px = U.pixelsize;
|
||||
const int category_tabs_width = round_fl_to_int(UI_PANEL_CATEGORY_MARGIN_WIDTH * zoom);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue