Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non-uniform border support #200

Closed
tomlm opened this issue Dec 11, 2024 · 0 comments · Fixed by #199
Closed

non-uniform border support #200

tomlm opened this issue Dec 11, 2024 · 0 comments · Fixed by #199
Assignees
Labels
enhancement New feature or request

Comments

@tomlm
Copy link
Collaborator

tomlm commented Dec 11, 2024

Only BorderThickness=1 is supported.

I have a branch tomlm/nonUniformBorder which tried to implement non-uniform border thickneses (ie: 1 0 1 1).
Essentially to do this avalonia switches to a StreamGeometry implementation which gathers up multiple line
strokes into a single geometry. I implemented all of that stuff but much to my dismay I discovered Avalonia
is very loose on single pixel variations

With a normal high DPI screen you never see it, but with a Char based UI an off by one is radically wrong.
I spent about 3 days trying to hack a way to correct the errors, but basically, but there doesn't seem to be a
strong correlation to when errors creep into the values.

It's an avalonia bug. Avalonia bug AvaloniaUI/Avalonia#17752 filed

This is what native avalonia renders for thickness 0 strokes. You can see it the layout of the rectangle is off by one or two pixels and the stroke doesn't align. That's exactly what it's drawing for us, only 1 pixel = 1 char so the error is crazy.
image

image

When this bug is fixed this branch should work.

This is what it looks like when the pixel errors becomes character scaled errors:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant