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

[WPF] the order of transformations is not correct #3271

Closed
MichaelRumpler opened this Issue Jul 10, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@MichaelRumpler
Copy link
Contributor

MichaelRumpler commented Jul 10, 2018

Description

If you apply more than one of Rotation, Scale and TranslationX/Y to any element, then the order of these transformations is not correct on WPF.

But that order is of crucial importance. If you rotate the element first and then change TranslationX, then the element is moved on the X axis. But if you first apply TranslationX and then rotate it by 90 degrees, the translation is actually along the Y axis.
The same problem occurs with Scale. If TranslationX is set to 100 first and then the Scale is set to 2, then the element will actually be moved by 200 which is wrong.
Scale and Rotation should be applied first and then TranslationX/Y.

Steps to Reproduce

  1. set Rotation="90" to any element
  2. change TranslationX on that same element

Expected Behavior

The rotated element should move along the X axis.

Actual Behavior

It moves along the Y axis.

Basic Information

  • Version with issue: 3.1.0.583944
  • IDE: VS2017 15.8, preview 3
  • Platform Target Frameworks:
    • WPF, .NET Framework 4.6.1, Windows 10

Reproduction Link

Repro.WPFTransformations.zip
The repro project is essentially a copy of the sample on https://docs.microsoft.com/en-us/xamarin/xamarin-forms/xaml/xaml-basics/data-binding-basics#the-binding-mode. I just changed RotationX/Y to TranslationX/Y.
I don't know why Scale doesn't work on UWP in this sample, but that's another problem. The text is scaled on WPF, only that it is applied in the wrong order. This is easily visible, when you change Scale to values less than one.

@pauldipietro pauldipietro added this to New in Triage Jul 10, 2018

@pauldipietro

This comment has been minimized.

Copy link
Member

pauldipietro commented Jul 10, 2018

Thanks for the repro, can see the difference in behavior

@pauldipietro pauldipietro moved this from New to Ready For Work in Triage Jul 10, 2018

@samhouts samhouts added this to In Progress in vCurrent (3.6.0) Jul 17, 2018

@samhouts samhouts removed this from Ready For Work in Triage Jul 17, 2018

@samhouts samhouts moved this from In Progress to Done in vCurrent (3.6.0) Aug 6, 2018

@samhouts samhouts removed this from Done in vCurrent (3.6.0) Sep 21, 2018

@samhouts samhouts added this to In Progress in v3.4.0 Sep 21, 2018

@samhouts samhouts moved this from In Progress to Done in v3.4.0 Sep 21, 2018

@samhouts samhouts removed this from Done in v3.4.0 Nov 19, 2018

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.