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:
authorTon Roosendaal <ton@blender.org>2012-12-19 15:55:41 +0400
committerTon Roosendaal <ton@blender.org>2012-12-19 15:55:41 +0400
commita970991da677000f10d9400aa4d6481d5a7b7927 (patch)
treefa6a1279afaf61628431c6ee05d69454a08256a1 /source
parent56bfd3235c62c5fe8ae14d12c975326441f7f655 (diff)
Icon scaling fix: for zoom levels near 1, icon positions are moved to exact pixel
locations. Makes default headers and menus always crisp.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_widgets.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index e5b26148be5..25e35c2e8ff 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -871,7 +871,7 @@ static void widget_draw_icon(uiBut *but, BIFIconID icon, float alpha, const rcti
aspect = but->block->aspect / UI_DPI_FAC;
height = ICON_DEFAULT_HEIGHT / aspect;
-
+
/* calculate blend color */
if (ELEM4(but->type, TOG, ROW, TOGN, LISTROW)) {
if (but->flag & UI_SELECT) {}
@@ -915,6 +915,12 @@ static void widget_draw_icon(uiBut *but, BIFIconID icon, float alpha, const rcti
ys = (rect->ymin + rect->ymax - height) / 2.0f;
}
+ /* force positions to integers, for zoom levels near 1. draws icons crisp. */
+ if (aspect > 0.95f && aspect < 1.05f) {
+ xs = (int)(xs + 0.1f);
+ ys = (int)(ys + 0.1f);
+ }
+
/* to indicate draggable */
if (but->dragpoin && (but->flag & UI_ACTIVE)) {
float rgb[3] = {1.25f, 1.25f, 1.25f};