Skip to content

Commit 0662bf1

Browse files
svc-reach-platform-supportEvergreen
authored andcommitted
[Port] [6000.4] [UUM-131603][UUM-131646] Fix some small ShaderGraph UI issues
1 parent a145130 commit 0662bf1

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

Packages/com.unity.shadergraph/Editor/Drawing/Inspector/PropertyDrawers/ShaderInputPropertyDrawer.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,11 +1499,15 @@ void CustomAttributesAddCallbacks()
14991499
m_CustomAttributesReorderableList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) =>
15001500
{
15011501
var entry = (AbstractShaderProperty.PropertyAttribute)m_CustomAttributesReorderableList.list[index];
1502-
Rect displayRect = new Rect(rect.x, rect.y, rect.width / 2, EditorGUIUtility.singleLineHeight);
1502+
float entryHeight = EditorGUIUtility.singleLineHeight;
1503+
float columnWidth = rect.width / 2;
1504+
float verticalPadding = (rect.height - entryHeight) / 2;
1505+
Rect nameDisplayRect = new Rect(rect.x, rect.y + verticalPadding, columnWidth, entryHeight);
1506+
Rect valueDisplayRect = new Rect(rect.x + columnWidth, rect.y + verticalPadding, columnWidth, entryHeight);
15031507

15041508
EditorGUI.BeginChangeCheck();
1505-
var name = EditorGUI.DelayedTextField(displayRect, entry.name, EditorStyles.label);
1506-
var value = EditorGUI.DelayedTextField(new Rect(rect.x + rect.width / 2, rect.y, rect.width / 2, EditorGUIUtility.singleLineHeight), entry.value);
1509+
var name = EditorGUI.DelayedTextField(nameDisplayRect, entry.name, EditorStyles.label);
1510+
var value = EditorGUI.DelayedTextField(valueDisplayRect, entry.value);
15071511

15081512
if (EditorGUI.EndChangeCheck())
15091513
{

Packages/com.unity.shadergraph/Editor/Drawing/Views/Slots/ColorRGBSlotControlView.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public ColorRGBSlotControlView(ColorRGBMaterialSlot slot)
1717
m_Slot = slot;
1818
var colorField = new ColorField
1919
{
20-
value = new Color(slot.value.x, slot.value.y, slot.value.z, 0),
20+
value = new Color(slot.value.x, slot.value.y, slot.value.z, 1),
2121
showEyeDropper = false,
2222
showAlpha = false,
2323
hdr = (slot.colorMode == ColorMode.HDR)

0 commit comments

Comments
 (0)