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:
authorPhilipp Oeser <info@graphics-engineer.com>2021-10-26 13:33:36 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-10-27 10:56:58 +0300
commitb94447a298146f273c848541a3122afea001ba39 (patch)
tree9e23901edd051a7af445484d07aa4213a4dcef51 /source/blender/editors/interface
parent16e1b18dd8899dbc47e971b5ca3deb7652ae954a (diff)
Fix T92494: Node Editor dot grid not respecting display resolution scale
This seems wrong and was especially noticeable since transform snapping does account for it (which was reported in T92494). Now divide the `DotGridLevelInfo` `step_factor` by the default of 20 for `U.widget_unit` and scale it later by the actual interface scale. note: when zooming, this will still always snap to the smallest dot level (not sure, with a bit more work it could be possible to only snap to the lowest visible level after fading?) Maniphest Tasks: T92494 Differential Revision: https://developer.blender.org/D13002
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/view2d.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 3b6a7e1e88e..eea6512f0f8 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -1324,15 +1324,15 @@ typedef struct DotGridLevelInfo {
} DotGridLevelInfo;
static const DotGridLevelInfo level_info[9] = {
- {128.0f, -0.1f, 0.01f},
- {64.0f, 0.0f, 0.025f},
- {32.0f, 0.025f, 0.15f},
- {16.0f, 0.05f, 0.2f},
- {8.0f, 0.1f, 0.25f},
- {4.0f, 0.125f, 0.3f},
- {2.0f, 0.25f, 0.5f},
- {1.0f, 0.7f, 0.9f},
- {0.5f, 0.6f, 0.9f},
+ {6.4f, -0.1f, 0.01f},
+ {3.2f, 0.0f, 0.025f},
+ {1.6f, 0.025f, 0.15f},
+ {0.8f, 0.05f, 0.2f},
+ {0.4f, 0.1f, 0.25f},
+ {0.2f, 0.125f, 0.3f},
+ {0.1f, 0.25f, 0.5f},
+ {0.05f, 0.7f, 0.9f},
+ {0.025f, 0.6f, 0.9f},
};
/**
@@ -1363,7 +1363,7 @@ void UI_view2d_dot_grid_draw(const View2D *v2d,
for (int level = 0; level < grid_levels; level++) {
const DotGridLevelInfo *info = &level_info[level];
- const float step = min_step * info->step_factor;
+ const float step = min_step * info->step_factor * U.widget_unit;
const float alpha_factor = (zoom_normalized - info->fade_in_start_zoom) /
(info->fade_in_end_zoom - info->fade_in_start_zoom);