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

Drawing error when border size set to zero. #179

Open
lendres opened this issue May 2, 2024 · 4 comments
Open

Drawing error when border size set to zero. #179

lendres opened this issue May 2, 2024 · 4 comments

Comments

@lendres
Copy link

lendres commented May 2, 2024

Describe the bug
There appears to be a minor issue with the borders if the border size is set to zero.

To Reproduce
Steps to reproduce the behavior:

  1. Using the sample, go to 'Settings'
  2. Set the 'Border Thickness' to zero (Click on the '-" button until it darkens).
  3. Close the settings and observe the vertical border between different columns. Resizing the window may be necessary to see the issue.
  4. Resizing the window causes the vertical border issue to appear, disappear, or move. There may be zero, one, or more than one vertical border.

Expected behavior
When the border size is set to zero, no vertical borders should be visible.

Screenshots
First example:
image

After changing the size of the window, the bar has moved:
image

Desktop (please complete the following information):

  • OS: Windows
  • Version 10.0.19044
  • Maui.DataGrid version 4.0.3
@symbiogenesis
Copy link
Collaborator

symbiogenesis commented May 4, 2024

I had seen this before, at some point.

I think this is a windows-only bug in upstream MAUI or WinUI

We use a combination of background color and padding at the DataGridCell level to efficiently produce a border effect. Compared to the slow Border controls. I had tried using ColumnSpacing at the DataGridRow level but I think it had some problems.

Using an actual Border control wouldn't help, either, since apparently resizing Border controls on Windows is likewise problematic. dotnet/maui#20407

The current approach of doing borders at the cell-level in general probably isn't ideal, because the widths are actually doubled. So if you want borders that have a width of 1, you would need to set BorderThickness to 0.5

Perhaps refactoring to using ColumnSpacing will work better today than in the past.

@symbiogenesis
Copy link
Collaborator

symbiogenesis commented May 4, 2024

I can reproduce it but only if I resize to very specific widths. The initial width doesn't show it.

image

@symbiogenesis
Copy link
Collaborator

symbiogenesis commented May 5, 2024

Just tried it. Using ColumnSpacing works but has the same issue.

#180

@symbiogenesis
Copy link
Collaborator

There was a bugfix in MAUI recently that may be related.

dotnet/maui#21197

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

No branches or pull requests

2 participants