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

Conversation

Projects
None yet
3 participants
@donandren
Copy link
Contributor

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

donandren and others added some commits Nov 2, 2018

@grokys
Copy link
Member

grokys left a comment

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?

Show resolved Hide resolved src/Avalonia.Controls/ViewBox.cs Outdated
@donandren

This comment has been minimized.

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

This comment has been minimized.

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.

donandren and others added some commits Nov 11, 2018

@grokys

grokys approved these changes Nov 19, 2018

Copy link
Member

grokys left a comment

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 donandren:prs/viewbox branch Nov 19, 2018

@grokys grokys added this to the 0.8.0 milestone Apr 3, 2019

@kekekeks kekekeks referenced this pull request Apr 5, 2019

Merged

0.8.0 release #50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.