Skip to content

Commit

Permalink
Merge pull request #48 from VRLabs/fix/fix-2019-support
Browse files Browse the repository at this point in the history
Fix 2019 support
  • Loading branch information
jellejurre committed May 21, 2024
2 parents 8beb806 + dd24d69 commit 97328ad
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 97328ad

Please sign in to comment.