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

Viewbox implementation #2066

Merged
merged 11 commits into from
Nov 19, 2018
Merged

Viewbox implementation #2066

merged 11 commits into from
Nov 19, 2018

Conversation

donandren
Copy link
Contributor

@donandren donandren commented Nov 2, 2018

  • What does the pull request do?
    Add Viewbox and simplifies LayoutTransform control
  • What is the current behavior?
    we don't have Viewbox
  • What is the updated/expected behavior with this PR?

Checklist:

  • Added unit tests (if possible)?
  • Added XML documentation to any related classes

Copy link
Member

@grokys grokys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a ViewBoxPage for the control catalog and compared it with the same page in WPF. The results don't look quite right.

WPF looks as I'd expect it to:

image

However, Avalonia doesn't look right:

image

Not quite sure what's causing the difference. Is this expected?

src/Avalonia.Controls/ViewBox.cs Outdated Show resolved Hide resolved
@donandren
Copy link
Contributor Author

donandren commented Nov 10, 2018

updated default of ClipToBounds to true (which i missed initially) to behave as wpf.
I think differences in wpf vs. avalonia are not caused by Viewbox itself.
not sure where they are coming from, but

  • GridRowDefinitions with Auto height in a StackPanel definatelly is a complex scenario and could be misleading.
  • having Path report it's default bounds might not be working as expected, not sure

anyway made tiny modifications to example page and it look like it's working fine:
https://gist.github.com/donandren/3105ed68cdb4f7871abf15045ae671bf

ps: it look to me that somehow wpf Grid is processing rowdefinitions Auto with * logic, when all rows are Auto and making some smart stuff with stackpanel/grid measurements

@grokys
Copy link
Member

grokys commented Nov 11, 2018

Yeah, I was wondering if the problem might be with Grid. Might be worth investigating this separately... Also could you add the ViewboxPage to ControlCatalog? Or I can add it if you'd prefer.

Copy link
Member

@grokys grokys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just pushed a quick fix to alphabetically order the pages in ControlCatalog, hope that's OK!

@grokys grokys merged commit 88424b4 into AvaloniaUI:master Nov 19, 2018
@donandren donandren deleted the prs/viewbox branch November 19, 2018 22:37
@grokys grokys added this to the 0.8.0 milestone Apr 3, 2019
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

Successfully merging this pull request may close these issues.

None yet

3 participants