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

[UWP] Fix column growing due to background image #2955

Merged
merged 6 commits into from
May 21, 2019

Conversation

almedina-ms
Copy link
Contributor

Fixes #2697

The issue was fixed using TileControl to render the cover image and using the ITileBrush interface to position the image where it must be and to stretch it to fill

There may be another issue where the background images make the card grow, this also fixes that

How verified

The test app was run and the results were updated

@almedina-ms almedina-ms changed the title [Uwp] Fix column growing due to background image [UWP] Fix column growing due to background image May 20, 2019
@almedina-ms almedina-ms added the Platform-XAML Bugs or features related to Xaml Renderer label May 20, 2019
@@ -114,7 +114,7 @@
},
{
"type": "Column",
"width": "auto",
Copy link
Member

@paulcam206 paulcam206 May 21, 2019

Choose a reason for hiding this comment

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

th": "auto", [](start = 9, length = 12)

do we have other tests that cover the "width": "auto" case? #ByDesign

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes but the result looks better with stretch width as auto overflows the card in UWP and WPF


In reply to: 286154178 [](ancestors = 286154178)

Copy link
Member

Choose a reason for hiding this comment

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

that's fine -- I just wanted to make sure we were getting visual verification for the auto case :)


In reply to: 286155401 [](ancestors = 286155401,286154178)

@@ -293,29 +302,47 @@ namespace AdaptiveNamespace
ComPtr<IUIElement> rectangleAsUIElement;
THROW_IF_FAILED(rectangleAsShape.As(&rectangleAsUIElement));

double originPositionX = (fillMode == BackgroundImageFillMode::Cover) ? 0.0 : (x * m_imageSize.Width) + offsetHorizontalAlignment;
double originPositionY = (fillMode == BackgroundImageFillMode::Cover) ? 0.0 : (y * m_imageSize.Height) + offsetVerticalAlignment;
Copy link
Member

Choose a reason for hiding this comment

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

I think I'd rather see this implemented as an if/else (same below)

Copy link
Member

@paulcam206 paulcam206 left a comment

Choose a reason for hiding this comment

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

:shipit:

@almedina-ms almedina-ms merged commit db0c951 into master May 21, 2019
@almedina-ms almedina-ms deleted the user/almedina-ms/UWPFixColumnHeight branch July 31, 2019 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform-XAML Bugs or features related to Xaml Renderer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UWP] Background images on columns incorrectly increase height of the column instead of clipping
2 participants