From 05ba9b8d459ad62ef174d00696e9fe33c9d9a375 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Thu, 29 Apr 2021 16:39:26 +0200 Subject: [PATCH] Fix models uvs preview drawing --- Source/Editor/Windows/Assets/ModelWindow.cs | 5 ++--- Source/Editor/Windows/Assets/SkinnedModelWindow.cs | 5 ++--- Source/Engine/UI/GUI/Common/RenderToTextureControl.cs | 7 ++++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Source/Editor/Windows/Assets/ModelWindow.cs b/Source/Editor/Windows/Assets/ModelWindow.cs index b16a01a73..9032f256b 100644 --- a/Source/Editor/Windows/Assets/ModelWindow.cs +++ b/Source/Editor/Windows/Assets/ModelWindow.cs @@ -565,7 +565,6 @@ namespace FlaxEditor.Windows.Assets public UVsLayoutPreviewControl() { Offsets = new Margin(4); - AnchorPreset = AnchorPresets.HorizontalStretchMiddle; AutomaticInvalidate = false; } @@ -619,9 +618,9 @@ namespace FlaxEditor.Windows.Assets } /// - protected override void DrawChildren() + public override void DrawSelf() { - base.DrawChildren(); + base.DrawSelf(); var size = Size; if (_channel == UVChannel.None || size.MaxValue < 5.0f) diff --git a/Source/Editor/Windows/Assets/SkinnedModelWindow.cs b/Source/Editor/Windows/Assets/SkinnedModelWindow.cs index f3d228f45..37318c49b 100644 --- a/Source/Editor/Windows/Assets/SkinnedModelWindow.cs +++ b/Source/Editor/Windows/Assets/SkinnedModelWindow.cs @@ -114,9 +114,9 @@ namespace FlaxEditor.Windows.Assets } /// - public override void Draw() + public override void DrawSelf() { - base.Draw(); + base.DrawSelf(); var style = Style.Current; var asset = _window.Asset; @@ -676,7 +676,6 @@ namespace FlaxEditor.Windows.Assets public UVsLayoutPreviewControl() { Offsets = new Margin(4); - AnchorPreset = AnchorPresets.HorizontalStretchMiddle; AutomaticInvalidate = false; } diff --git a/Source/Engine/UI/GUI/Common/RenderToTextureControl.cs b/Source/Engine/UI/GUI/Common/RenderToTextureControl.cs index 3894c3027..e2e1532f3 100644 --- a/Source/Engine/UI/GUI/Common/RenderToTextureControl.cs +++ b/Source/Engine/UI/GUI/Common/RenderToTextureControl.cs @@ -55,8 +55,9 @@ namespace FlaxEngine.GUI /// public bool AutomaticInvalidate { get; set; } = true; +#if FLAX_EDITOR private bool CanEditTextureSize => !_autoSize; - +#endif /// /// Invalidates the cached image of children controls and invokes the redraw to the texture. /// @@ -105,7 +106,7 @@ namespace FlaxEngine.GUI } /// - public override void DrawSelf() + public override void Draw() { // Draw cached texture if (_texture && !_invalid && !_isDuringTextureDraw) @@ -119,7 +120,7 @@ namespace FlaxEngine.GUI } // Draw default UI directly - base.DrawSelf(); + base.Draw(); } ///