Skip to content

Commit

Permalink
Add if define
Browse files Browse the repository at this point in the history
  • Loading branch information
jellejurre committed May 14, 2024
1 parent 8beb806 commit dd24d69
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Editor/AV3Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,14 @@ private void LoadTabs(VisualElement tabsArea)
var iconElement = new VisualElement();
iconElement.style.backgroundImage = new StyleBackground(tab?.TabIcon);
iconElement.style.flexGrow = 1;

#if UNITY_2022_1_OR_NEWER
iconElement.style.backgroundPositionX = new BackgroundPosition(BackgroundPositionKeyword.Center);
iconElement.style.backgroundPositionY = new BackgroundPosition(BackgroundPositionKeyword.Center);
iconElement.style.backgroundRepeat = new BackgroundRepeat(Repeat.NoRepeat, Repeat.NoRepeat);
iconElement.style.backgroundSize = new BackgroundSize(BackgroundSizeType.Contain);

#else
iconElement.style.unityBackgroundScaleMode = ScaleMode.ScaleToFit;
#endif
tabButton.Add(iconElement);
tabButton.AddToClassList("tab-button");

Expand Down

0 comments on commit dd24d69

Please sign in to comment.