diff --git a/src/Consolonia.Core/Drawing/ConsoloniaRenderInterface.cs b/src/Consolonia.Core/Drawing/ConsoloniaRenderInterface.cs index 9d6d9232..0bba07fb 100644 --- a/src/Consolonia.Core/Drawing/ConsoloniaRenderInterface.cs +++ b/src/Consolonia.Core/Drawing/ConsoloniaRenderInterface.cs @@ -50,13 +50,10 @@ public IGeometryImpl CreateCombinedGeometry(GeometryCombineMode combineMode, IGe if (g1 is not StreamGeometryImpl stream1 || g2 is not StreamGeometryImpl stream2) throw new ArgumentException("Only StreamGeometryImpl is supported"); - Debug.WriteLine($"====="); - Debug.WriteLine($"Stream1 Bounds: {stream1.Bounds}"); - Debug.WriteLine($"Stream2 Bounds: {stream2.Bounds}"); - var newGeometry = CreateStreamGeometry(); using (var ctx = newGeometry.Open()) { + // Resharper disable UnusedVariable var hasLeftStroke = stream2.Bounds.X == 1; var hasTopStroke = stream2.Bounds.Y == 1; var hasRightStroke = (stream1.Bounds.Width - stream2.Bounds.Width) == stream2.Bounds.X + 1; @@ -69,6 +66,7 @@ public IGeometryImpl CreateCombinedGeometry(GeometryCombineMode combineMode, IGe var rightStroke = stream1.Strokes[1]; var bottomStroke = stream1.Strokes[2]; var leftStroke = stream1.Strokes[3]; + // Resharper enable UnusedVariable // Layout patches. This is a mess, see avalonia bug https://github.com/AvaloniaUI/Avalonia/issues/17752 diff --git a/src/Consolonia.Core/Drawing/DrawingContextImpl.cs b/src/Consolonia.Core/Drawing/DrawingContextImpl.cs index e99989ee..f53324b0 100644 --- a/src/Consolonia.Core/Drawing/DrawingContextImpl.cs +++ b/src/Consolonia.Core/Drawing/DrawingContextImpl.cs @@ -612,8 +612,6 @@ private void DrawEdgeLine(Line line, RectangleLinePosition linePosition, LineSty if (includeEndSymbol) DrawLineSymbolAndMoveHead(ref head, line.Vertical, endSymbol, color, 1); - else - head += line.Vertical ? new Vector(0, 1) : new Vector(1, 0); } /// diff --git a/src/Tests/Consolonia.Gallery.Tests/BorderTests.cs b/src/Tests/Consolonia.Gallery.Tests/BorderTests.cs new file mode 100644 index 00000000..99004c06 --- /dev/null +++ b/src/Tests/Consolonia.Gallery.Tests/BorderTests.cs @@ -0,0 +1,24 @@ +using System.Threading.Tasks; +using Avalonia.Input; +using Consolonia.Gallery.Tests.Base; +using Consolonia.NUnit; +using NUnit.Framework; + +namespace Consolonia.Gallery.Tests +{ + [TestFixture] + internal class BordersTests : GalleryTestsBaseBase + { + [Test] + public async Task PerformSingleTest() + { + await UITest.KeyInput(Key.Tab); + await UITest.AssertHasText("┌───────┐┌────────────────────┐╔════════════════════╗", + "│Default││LineStyle=SingleLine│║LineStyle=DoubleLine║", + "└───────┘└────────────────────┘╚════════════════════╝", + " ▁▁▁▁▁▁▁▁▁▁▁▁▁▁ ▗▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▖████████████████ ", + "▕LineStyle=Edge▏▐LineStyle=EdgeWide▌█LineStyle=Bold█ ", + " ▔▔▔▔▔▔▔▔▔▔▔▔▔▔ ▝▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▘████████████████ "); + } + } +} \ No newline at end of file