ewerspej / epj.RadialDial.Maui

A simple multi-purpose component that can be used as a circular dial or gauge as well as a progress ring or progress indicator.
MIT License
8 stars 0 forks source link

Feature Request: End Cap Radius #3

Open DevonKyleSham opened 8 months ago

DevonKyleSham commented 8 months ago

Hey, Just wondering if there is a way we could choose an "endCapRadius", similar to the cornerRadius on other elements in MAUI. This in combination with choosing the DialWidth would be very useful to me. It would allow for a rectangle with rounded corners or just a pure rounded end as an "endCap". It would be great if we could set this radius for the start of the progress bar and the end of the progress bar seperately.

Something like this:

image

ewerspej commented 8 months ago

Hi @DevonKyleSham,

thanks for your feature request.

Sure, I could try to implement something like an EndCapRadius for the value indicator. At the moment, the base is drawn as a full circle, so there is no way to set the start and end caps for the base, yet. Note that the radial dial currently doesn't support ranged values, either.

This won't be an easy feat, though, because SkiaSharp doesn't allow to set different cap types for a path, so I would need to break the path into at least two segments, each with their own cap style, which may lead to unwanted artifacts. I already had a look and it doesn't seem straightforward to do. If I find the time, I might implement this. You're welcome to provide a PR for this.

Cheers!