Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2020-11-18 21:49:20 +0300
committerJulian Eisel <julian@blender.org>2020-11-18 21:54:35 +0300
commitad58999b0d46731d8587d4eaf35f37f484cfe023 (patch)
tree664331b92694506ce25a035cdab6c911d737c954 /source
parent9a8f5022b70f3b33968b61b54f2b2c785b2f5145 (diff)
Fix pin icon in Properties not right-aligned after zooming
The logic for separator-spacers (used here for right-alignment) didn't take region scaling into account. Usually that's not an issue because they are otherwise only used in headers which can't zoom.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index dc20e6f1813..d75909bef87 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -64,6 +64,7 @@
#include "UI_interface.h"
#include "UI_interface_icons.h"
+#include "UI_view2d.h"
#include "IMB_imbuf.h"
@@ -286,11 +287,12 @@ static void ui_update_flexible_spacing(const ARegion *region, uiBlock *block)
}
}
+ const float view_scale_x = UI_view2d_scale_get_x(&region->v2d);
const float segment_width = region_width / (float)sepr_flex_len;
float offset = 0, remaining_space = region_width - buttons_width;
i = 0;
LISTBASE_FOREACH (uiBut *, but, &block->buttons) {
- BLI_rctf_translate(&but->rect, offset, 0);
+ BLI_rctf_translate(&but->rect, offset / view_scale_x, 0);
if (but->type == UI_BTYPE_SEPR_SPACER) {
/* How much the next block overlap with the current segment */
int overlap = ((i == sepr_flex_len - 1) ? buttons_width - spacers_pos[i] :