@@ -38,51 +38,52 @@ public static void DrawItemInList(Rect rect, SerializedCompositionLayer serializ
3838
3939 // Compute the desired indentation
4040 {
41- rect . x = isCameraStack ? rect . x + CompositorStyle . k_ListItemStackPading + 2 : rect . x + 2 ;
42- rect . width = isCameraStack ? rect . width - CompositorStyle . k_ListItemStackPading : rect . width ;
41+ const float listBorder = 2.0f ;
42+ rect . x = isCameraStack ? rect . x + CompositorStyle . k_ListItemStackPading + listBorder : rect . x + listBorder ;
43+ rect . width = isCameraStack ? rect . width - CompositorStyle . k_ListItemStackPading - listBorder : rect . width - listBorder ;
4344 rect . y += CompositorStyle . k_ListItemPading ;
4445 rect . height = EditorGUIUtility . singleLineHeight ;
4546 }
4647
4748 if ( thumbnail )
4849 {
4950 Rect newRect = rect ;
50- newRect . width = 20 ;
51+ newRect . width = EditorGUIUtility . singleLineHeight ;
5152 EditorGUI . PropertyField ( newRect , serialized . Show , GUIContent . none ) ;
52- rect . x += 20 ;
53+ rect . x += CompositorStyle . k_CheckboxSpacing ;
5354 Rect previewRect = rect ;
5455 previewRect . width = CompositorStyle . k_ThumbnailSize * aspectRatio ;
5556 previewRect . height = CompositorStyle . k_ThumbnailSize ;
5657 EditorGUI . DrawPreviewTexture ( previewRect , thumbnail ) ;
57- previewRect . x += previewRect . width + 5 ;
58- rect . x += previewRect . width + 12 ;
59- rect . width -= previewRect . width + 12 ;
58+ previewRect . x += previewRect . width + CompositorStyle . k_ThumbnailDivider ;
59+ rect . x += previewRect . width + CompositorStyle . k_ThumbnailSpacing ;
60+ rect . width -= previewRect . width + CompositorStyle . k_ThumbnailSpacing ;
6061
6162 if ( isAlphaEnbaled
6263 && ( thumbnail . format == RenderTextureFormat . ARGBHalf
6364 || thumbnail . format == RenderTextureFormat . ARGBFloat
6465 || thumbnail . format == RenderTextureFormat . ARGB64 ) )
6566 {
6667 EditorGUI . DrawTextureAlpha ( previewRect , thumbnail ) ;
67- rect . x += previewRect . width + 12 ;
68- rect . width -= previewRect . width + 12 ;
68+ rect . x += previewRect . width + CompositorStyle . k_ThumbnailSpacing ;
69+ rect . width -= previewRect . width + CompositorStyle . k_ThumbnailSpacing ;
6970 }
7071
71- rect . y += 6 ;
72+ rect . y += CompositorStyle . k_LabelVerticalOffset ;
7273 EditorGUI . LabelField ( rect , serialized . LayerName . stringValue ) ;
7374 }
7475 else
7576 {
7677 Rect newRect = rect ;
77- newRect . width = 20 ;
78+ newRect . width = EditorGUIUtility . singleLineHeight ;
7879 EditorGUI . PropertyField ( newRect , serialized . Show , GUIContent . none ) ;
79- newRect . x += 20 ;
80+ newRect . x += CompositorStyle . k_CheckboxSpacing ;
8081 if ( isCameraStack )
8182 {
8283 Rect iconRect = newRect ;
8384 iconRect . width = CompositorStyle . k_IconSize ;
8485 iconRect . height = CompositorStyle . k_IconSize ;
85- iconRect . y -= 5 ;
86+ iconRect . y -= CompositorStyle . k_IconVerticalOffset ;
8687 switch ( serialized . InputLayerType . enumValueIndex )
8788 {
8889 case ( int ) CompositorLayer . LayerType . Camera :
@@ -99,12 +100,11 @@ public static void DrawItemInList(Rect rect, SerializedCompositionLayer serializ
99100 Debug . Log ( "Unknown layer type: Please add code here to draw this type of layer." ) ;
100101 break ;
101102 }
102- newRect . x += CompositorStyle . k_IconSize + 5 ;
103+ newRect . x += CompositorStyle . k_IconSize + CompositorStyle . k_IconSpacing ;
103104 }
104105
105- newRect . width = rect . width - 60 - 20 ;
106+ newRect . width = rect . width - newRect . x ;
106107 EditorGUI . LabelField ( newRect , serialized . LayerName . stringValue ) ;
107- rect . y += rect . height ;
108108 }
109109 }
110110
0 commit comments