From 2c39f80f9bab22fbdb66d41db33543a84f556ba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pedro?= Date: Tue, 9 Aug 2022 17:43:12 +0100 Subject: [PATCH 1/2] Changed Skia OpenGL bitmap origin to bottom left. --- samples/ControlCatalog/Pages/OpenGlPage.xaml.cs | 2 +- src/Skia/Avalonia.Skia/Gpu/OpenGl/OpenGlBitmapImpl.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/ControlCatalog/Pages/OpenGlPage.xaml.cs b/samples/ControlCatalog/Pages/OpenGlPage.xaml.cs index f37e0f8701..063ad50b0b 100644 --- a/samples/ControlCatalog/Pages/OpenGlPage.xaml.cs +++ b/samples/ControlCatalog/Pages/OpenGlPage.xaml.cs @@ -345,7 +345,7 @@ namespace ControlCatalog.Pages 0.01f, 1000); - var view = Matrix4x4.CreateLookAt(new Vector3(25, 25, 25), new Vector3(), new Vector3(0, -1, 0)); + var view = Matrix4x4.CreateLookAt(new Vector3(25, 25, 25), new Vector3(), new Vector3(0, 1, 0)); var model = Matrix4x4.CreateFromYawPitchRoll(_yaw, _pitch, _roll); var modelLoc = GL.GetUniformLocationString(_shaderProgram, "uModel"); var viewLoc = GL.GetUniformLocationString(_shaderProgram, "uView"); diff --git a/src/Skia/Avalonia.Skia/Gpu/OpenGl/OpenGlBitmapImpl.cs b/src/Skia/Avalonia.Skia/Gpu/OpenGl/OpenGlBitmapImpl.cs index a4617bb4d5..fb69a1ad3d 100644 --- a/src/Skia/Avalonia.Skia/Gpu/OpenGl/OpenGlBitmapImpl.cs +++ b/src/Skia/Avalonia.Skia/Gpu/OpenGl/OpenGlBitmapImpl.cs @@ -41,7 +41,7 @@ namespace Avalonia.Skia new GRGlTextureInfo( GlConsts.GL_TEXTURE_2D, (uint)_surface.GetTextureId(), (uint)_surface.InternalFormat))) - using (var surface = SKSurface.Create(context.GrContext, backendTexture, GRSurfaceOrigin.TopLeft, + using (var surface = SKSurface.Create(context.GrContext, backendTexture, GRSurfaceOrigin.BottomLeft, SKColorType.Rgba8888)) { // Again, silently ignore, if something went wrong it's not our fault From a097605ef5557fea7980664accfd95a490776578 Mon Sep 17 00:00:00 2001 From: Giuseppe Lippolis Date: Wed, 10 Aug 2022 11:44:48 +0200 Subject: [PATCH 2/2] fix(AutoCompleteBox): PopulateDropDown handler is not unregister when MinimumPopulateDelay is set to Zero. --- src/Avalonia.Controls/AutoCompleteBox.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Avalonia.Controls/AutoCompleteBox.cs b/src/Avalonia.Controls/AutoCompleteBox.cs index 5c95932c1f..c675139831 100644 --- a/src/Avalonia.Controls/AutoCompleteBox.cs +++ b/src/Avalonia.Controls/AutoCompleteBox.cs @@ -392,6 +392,8 @@ namespace Avalonia.Controls private AutoCompleteSelector? _itemSelector; private AutoCompleteSelector? _textSelector; + private readonly EventHandler _populateDropDownHandler; + public static readonly RoutedEvent SelectionChangedEvent = RoutedEvent.Register(nameof(SelectionChanged), RoutingStrategies.Bubble, typeof(AutoCompleteBox)); @@ -668,6 +670,7 @@ namespace Avalonia.Controls if (newValue == TimeSpan.Zero) { + _delayTimer.Tick -= _populateDropDownHandler; _delayTimer = null; } } @@ -678,7 +681,7 @@ namespace Avalonia.Controls if (_delayTimer == null) { _delayTimer = new DispatcherTimer(); - _delayTimer.Tick += PopulateDropDown; + _delayTimer.Tick += _populateDropDownHandler; } // Set the new tick interval @@ -864,6 +867,7 @@ namespace Avalonia.Controls /// public AutoCompleteBox() { + _populateDropDownHandler = PopulateDropDown; ClearView(); } @@ -1771,10 +1775,7 @@ namespace Avalonia.Controls /// The event arguments. private void PopulateDropDown(object? sender, EventArgs e) { - if (_delayTimer != null) - { - _delayTimer.Stop(); - } + _delayTimer?.Stop(); // Update the prefix/search text. SearchText = Text;