From 37f513e5dc904a5134f243cbb7a43cd01bad97bd Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 17 Sep 2026 02:08:40 +0200 Subject: [PATCH] Keep the schematic underlay under the shape grid The port dropped the legacy drawer's FlexibleSpace, so the grid's group stretched to the inspector width and the texture was fitted there instead. Checked by the operator in Studio on LonginusX. Co-Authored-By: Claude Opus 5 --- Assets/Scripts/Editor/CultCacheDrawers.cs | 37 +++++++++++++---------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/Assets/Scripts/Editor/CultCacheDrawers.cs b/Assets/Scripts/Editor/CultCacheDrawers.cs index 0da93996e..75fe59ccd 100644 --- a/Assets/Scripts/Editor/CultCacheDrawers.cs +++ b/Assets/Scripts/Editor/CultCacheDrawers.cs @@ -117,25 +117,30 @@ public sealed class InspectableSchematicShapeDrawer : ICultInspectorDrawer if (width != shape.Width || height != shape.Height) shape.Resize(width, height); } - using (var grid = new EditorGUILayout.VerticalScope()) + // The flexible space shrinks the grid group to its toggles, so the texture fits the grid, not the inspector width. + using (new EditorGUILayout.HorizontalScope()) { - if (schematic != null && Event.current.type == EventType.Repaint) + using (var grid = new EditorGUILayout.VerticalScope()) { - _schematicMaterial ??= new Material(Shader.Find("Legacy Shaders/Particles/Additive")); - EditorGUI.DrawPreviewTexture(grid.rect, schematic, _schematicMaterial); - } + if (schematic != null && Event.current.type == EventType.Repaint) + { + _schematicMaterial ??= new Material(Shader.Find("Legacy Shaders/Particles/Additive")); + EditorGUI.DrawPreviewTexture(grid.rect, schematic, _schematicMaterial); + } - for (var y = shape.Height - 1; y >= 0; y--) - using (new EditorGUILayout.HorizontalScope()) - for (var x = 0; x < shape.Width; x++) - { - var hardpoint = hull?.Hardpoints.FirstOrDefault(hp => hp.Shape.Coordinates - .Any(v => v.x + hp.Position.x == x && v.y + hp.Position.y == y)); - var previous = GUI.backgroundColor; - if (hardpoint != null) GUI.backgroundColor = hardpoint.TintColor.ToColor(); - shape[int2(x, y)] = GUILayout.Toggle(shape[int2(x, y)], GUIContent.none, GUILayout.Width(16)); - GUI.backgroundColor = previous; - } + for (var y = shape.Height - 1; y >= 0; y--) + using (new EditorGUILayout.HorizontalScope()) + for (var x = 0; x < shape.Width; x++) + { + var hardpoint = hull?.Hardpoints.FirstOrDefault(hp => hp.Shape.Coordinates + .Any(v => v.x + hp.Position.x == x && v.y + hp.Position.y == y)); + var previous = GUI.backgroundColor; + if (hardpoint != null) GUI.backgroundColor = hardpoint.TintColor.ToColor(); + shape[int2(x, y)] = GUILayout.Toggle(shape[int2(x, y)], GUIContent.none, GUILayout.Width(16)); + GUI.backgroundColor = previous; + } + } + GUILayout.FlexibleSpace(); } return shape; }