dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.2k stars 1.75k forks source link

Maui-WinUI : Unable to re use the path for gap filled arc shape drawing #3507

Closed MuneeshKumarG closed 2 years ago

MuneeshKumarG commented 2 years ago

Description

We have a requirement of Arc with Dash Array support. So, we draw more arcs with gap in single path, run time it throws below exception.

This issue reproduced only in Maui-WinUI. In Android and iOS, outputs showing as we expected.

I have used Maui preview 10.

   at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
   at ABI.Microsoft.Graphics.Canvas.Geometry.ICanvasPathBuilder.global::Microsoft.Graphics.Canvas.Geometry.ICanvasPathBuilder.AddLine(Single x, Single y)
   at Microsoft.Maui.Graphics.Win2D.W2DExtensions.AsPath(PathF path, Single ox, Single oy, Single fx, Single fy, ICanvasResourceCreator creator, CanvasFilledRegionDetermination fillMode)
   at Microsoft.Maui.Graphics.Win2D.W2DExtensions.AsPath(PathF path, ICanvasResourceCreator creator, CanvasFilledRegionDetermination fillMode)
   at Microsoft.Maui.Graphics.Win2D.W2DCanvas.GetPath(PathF path, CanvasFilledRegionDetermination fillMode)
   at Microsoft.Maui.Graphics.Win2D.W2DCanvas.FillPath(PathF path, WindingMode windingMode)
   at Microsoft.Maui.Graphics.CanvasExtensions.FillPath(ICanvas target, PathF path)
   at Syncfusion.Maui.Gauges.RadialAxis.DrawAxisLine(ICanvas canvas) in D:\temp\Preview10\Gauge\TestSampleWindows\src\maui-gauges\maui\src\gauges\RadialGauge\RadialAxis\RadialAxis.cs:line 2011
   at Syncfusion.Maui.Gauges.RadialAxisView.Draw(ICanvas canvas, RectangleF dirtyRect) in D:\temp\Preview10\Gauge\TestSampleWindows\src\maui-gauges\maui\src\gauges\RadialGauge\Renderer\RadialAxisView.cs:line 54
   at Microsoft.Maui.Graphics.Win2D.W2DGraphicsView.OnDraw(CanvasControl sender, CanvasDrawEventArgs args)
   at WinRT._EventSource_global__Windows_Foundation_TypedEventHandler_global__Microsoft_Graphics_Canvas_UI_Xaml_CanvasControl__global__Microsoft_Graphics_Canvas_UI_Xaml_CanvasDrawEventArgs_.<get_EventInvoke>b__3_0(CanvasControl sender, CanvasDrawEventArgs args)

Steps to Reproduce

We used below codes for add more gap filled arcs in single path.

  pathF.AddArc(outerArcTopLeft, outerArcBottomRight, -(float)startAngle, -(float)endAngle, true);

           ..

            pathF.LineTo(point);
            pathF.AddArc(innerArcTopLeft, innerArcBottomRight, -(float)endAngle, -(float)startAngle, false);

           ..

            pathF.LineTo(point);
            pathF.Close();

When we remove the path.Close() method, arc rendering with connected lines as attached below.

image

But we need to separate each arc with gap. Please check and update us the solution for this.

Version with bug

Preview 10 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

net6.0-windows10.0.19041

Did you find any workaround?

No response

Relevant log output

No response

jsuarezruiz commented 2 years ago

Could you attach a small sample where reproduce the issue?. Thanks!

MuneeshKumarG commented 2 years ago

I have given details from our library. It will take more time for sample preparation. Please check above details and let us know if you need any other details.

shimingsg commented 2 years ago

@MuneeshKumarG can you share your repro projects?

ghost commented 2 years ago

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.