Skip to content

Commit 9ba9463

Browse files
committed
feat: Call Repaint() on draw custom background
1 parent 64ff609 commit 9ba9463

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

Editor/Scripts/AssetQuickAccessWindow.BottomTips.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ private void DrawBottomTips()
2121
GUILayout.Label("Drag the asset here to add a new item.", _bottomTipsStyle);
2222
}
2323

24-
private void ClearBottomTipsGuiStytleCaches()
24+
private void ClearBottomTipsGuiCaches()
2525
{
2626
_bottomTipsStyle = null;
2727
}

Editor/Scripts/AssetQuickAccessWindow.ListContent.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ private void DrawAssetListItemBackground(Rect rect, int index, bool active, bool
6161
GUI.color = rect.Contains(Event.current.mousePosition) ? Color.cyan : guiColor;
6262
GUI.Box(bgRect, (string)null);
6363
GUI.color = guiColor;
64+
Repaint();
6465
}
6566

6667
private void DrawAssetListItem(Rect rect, int index, bool isActive, bool isFocused)
@@ -404,7 +405,7 @@ private void ProcessAssetItemAction(Rect dragArea, AssetHandle assetHandle)
404405
}
405406
}
406407

407-
private void ClearListContentGuiStyleCaches()
408+
private void ClearListContentGuiCaches()
408409
{
409410
_assetItemStyle = null;
410411
}

Editor/Scripts/AssetQuickAccessWindow.OnGUI.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ private void ProcessDragAndDropIn()
5252
}
5353
}
5454

55-
private void ClearAllGuiStytleCaches()
55+
private void ClearAllGuiCaches()
5656
{
57-
ClearToolbarGuiStyleCaches();
58-
ClearListContentGuiStyleCaches();
59-
ClearBottomTipsGuiStytleCaches();
57+
ClearToolbarGuiCaches();
58+
ClearListContentGuiCaches();
59+
ClearBottomTipsGuiCaches();
6060
}
6161
}
6262
}

Editor/Scripts/AssetQuickAccessWindow.Toolbar.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,14 @@ private void DrawToolbar()
6565
{
6666
normal = { background = Texture2D.grayTexture }
6767
});
68+
Repaint();
6869
}
6970
}
7071
}
7172

72-
private void ClearToolbarGuiStyleCaches()
73+
private void ClearToolbarGuiCaches()
7374
{
75+
_toolbarMenuContent = null;
7476
_toolbarMenuStyle = null;
7577
}
7678
}

Editor/Scripts/AssetQuickAccessWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private void OnDisable()
154154
private void OnFocus()
155155
{
156156
// FIX: Gui styles may be lost
157-
ClearAllGuiStytleCaches();
157+
ClearAllGuiCaches();
158158
}
159159

160160
private void ShowButton(Rect position)

0 commit comments

Comments
 (0)