Skip to content

Flipper applies scale when content size changes #835

Description

@mycroes

I noticed some awkward behavior with the flipper where it seems to scale if the content shrinks (requires less space than before), in my case when a combobox selection is reset. Luckily I happened to have two identical flippers with identical content:
flipper scale

It seems like a scale transformation is applied on the Viewport2DVisual3D (this is the right flipper):
viewport2dvisual3dright

And here's left for comparison:
viewport2dvisual3dleft

I guess the issue might com from the following piece in Plane3D:

private void Update3D()
        {
            // Use GetDescendantBounds for sizing and centering since DesiredSize includes layout whitespace, whereas GetDescendantBounds 
            // is tighter
            var logicalBounds = VisualTreeHelper.GetDescendantBounds(_logicalChild);
            var w = logicalBounds.Width;
            var h = logicalBounds.Height;
            ...
            _scaleTransform.ScaleX = w;
            _scaleTransform.ScaleY = h;

I'm not sure why this doesn't match the actual content size when it shrinks, (or actually, maybe this isn't called when the content shrinks?) but flipping the card back and forth fixes the scale.

I'm sorry for the huge screenshots, they were taken at 200% scale.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Waiting on feedbackAdditional information is needed. Stale items with this label may be closed.bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions