UI: Improve node editor dot background

This commit makes the dot grid used as background in the node editor
more visually stable when zooming in and out.

The dot grid now uses a continuously subdividing pattern, where
each level of subdivision divides the previous five times, similar to
the line grid in the 3D viewport.

The maximum for the "Grid Levels" theme setting is changed to 3, since
any further subdivisions are too small to be visible.
The "Grid Levels" value for the default themes "Blender Dark" and
"Blender Light" is therefore changed to 3, as well.

Reviewed By: Hans Goudey, Pablo Vazquez

Differential Revision: http://developer.blender.org/D13302
This commit is contained in:
2022-03-30 21:21:57 +02:00
parent 922d53a791
commit 2670032038
8 changed files with 58 additions and 45 deletions

View File

@@ -178,12 +178,12 @@ void UI_view2d_multi_grid_draw(
* \param grid_color_id: The theme color used for the points. Faded dynamically based on zoom.
* \param min_step: The base size of the grid. At different zoom levels, the visible grid may have
* a larger step size.
* \param grid_levels: The maximum grid depth. Larger grid levels will subdivide the grid more.
* \param grid_subdivisions: The maximum number of sub-levels drawn at once.
*/
void UI_view2d_dot_grid_draw(const struct View2D *v2d,
int grid_color_id,
float min_step,
int grid_levels);
int grid_subdivisions);
void UI_view2d_draw_lines_y__values(const struct View2D *v2d);
void UI_view2d_draw_lines_x__values(const struct View2D *v2d);