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
diff options
context:
space:
mode:
authorLeon Leno <lone_noel>2021-11-06 00:32:35 +0300
committerHans Goudey <h.goudey@me.com>2021-11-06 00:32:35 +0300
commit9be49a10699417aa5902144d99ff70e5e1fc6af8 (patch)
tree61a32bddf5f883e3dc9ceff9a00c7d4e5b96fcbd /source/blender/editors/interface/interface_icons.c
parent97ff37bf54474efbce39653a1387ad55091d4964 (diff)
Fix: Property editor icon jittering in some cases
In the tools tab, the tool icon would be offset when it intersected the bottom of the editor. With some screen resolutions, the icons on the left side of the editor would also move when intersecting the bottom of the editor. This happened because of the truncation in the implicit conversion from float to int. Instead, use explicit conversion functions. Differential Revision: https://developer.blender.org/D11097
Diffstat (limited to 'source/blender/editors/interface/interface_icons.c')
-rw-r--r--source/blender/editors/interface/interface_icons.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index 5784af90834..c1dd4fcb4e4 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -1503,7 +1503,8 @@ static void icon_draw_rect(float x,
int draw_w = w;
int draw_h = h;
int draw_x = x;
- int draw_y = y;
+ /* We need to round y, to avoid the icon jittering in some cases. */
+ int draw_y = round_fl_to_int(y);
/* sanity check */
if (w <= 0 || h <= 0 || w > 2000 || h > 2000) {