Geometry Nodes: use shorter linear gizmo when using box shape

This solves an issue when both linear gizmos happen to be at the same position.
In this case the gizmos became fairly unusable because they overlapped a lot.
They can still overlap of course, but it's more likely that they start at the
same position than that they end at the same position.

Note, when using a transform gizmo, the collision between the scale and
translate gizmo is resolved already. The issue only happens when two independent
Linear Gizmo nodes are used.

Pull Request: https://projects.blender.org/blender/blender/pulls/128371
This commit is contained in:
Jacques Lucke
2024-09-30 15:43:20 +02:00
parent d58176e1e0
commit 02ada0d064

View File

@@ -236,6 +236,10 @@ class LinearGizmo : public NodeGizmos {
WM_gizmo_set_line_width(gizmo_, 1.0f);
const float length = (storage.draw_style == GEO_NODE_LINEAR_GIZMO_DRAW_STYLE_BOX) ? 0.8f :
1.0f;
RNA_float_set(gizmo_->ptr, "length", length);
const ThemeColorID color_theme_id = get_gizmo_theme_color_id(
GeometryNodeGizmoColor(storage.color_id));
UI_GetThemeColor3fv(color_theme_id, gizmo_->color);