Skip to content

[WASM] Add full support of RenderTransform in TransformToVisual - #2091

Merged
dr1rrb merged 17 commits into
masterfrom
dev/dr/TouchTrans
Nov 19, 2019
Merged

dr1rrb merged 17 commits into
masterfrom
dev/dr/TouchTrans

Conversation

@dr1rrb

@dr1rrb dr1rrb commented Nov 14, 2019 •

Copy link
Copy Markdown
Member

GitHub Issue (If applicable): #2035

BugFix & Feature

Add full support of the RenderTransform in the UIElement.TransformToVisual

What is the current behavior?

The UIElement.TransformToVisual only request the current bounds of the UIElements and makes a diff to get an approximation of the offsetX and offsetY, but does not take in consideration the possible scale in between, nor the rotation.

On WASM this impacts the pointers coordinates as they are computed from absolute coordinates and should be "scaled down" in order to remain in the bounds of the control.

What is the new behavior?

The returned transform is now including scale and rotation applied by any parent control.

PR Checklist

  • Tested code with current supported SDKs
  • Docs have been added/updated which fit documentation template (for bug fixes / features)
  • Unit Tests and/or UI Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Wasm UI Tests are not showing unexpected any differences. Validate PR Screenshots Compare Test Run results.
  • Contains NO breaking changes
  • Updated the Release Notes
  • Associated with an issue (GitHub or internal)

@gitpod-io

gitpod-io Bot commented Nov 14, 2019 •

Copy link
Copy Markdown

@github-actions github-actions Bot added the platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform label Nov 14, 2019
@dr1rrb dr1rrb mentioned this pull request Nov 14, 2019
1 of 7 tasks
@dr1rrb dr1rrb self-assigned this Nov 14, 2019

@davidjohnoliver davidjohnoliver left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Needs tests

@dr1rrb

dr1rrb commented Nov 15, 2019

Copy link
Copy Markdown
Member Author

Needs tests

Obviously! I will also add some documentation :) But before I'll see if I can multi target this method

@carldebilly

Copy link
Copy Markdown
Member

@davidjohnoliver @jeromelaban @ghuntley
I think we should'nt comment about missing tests, commented code or missing documentation when it's still a draft PR.

@davidjohnoliver

Copy link
Copy Markdown
Contributor

@davidjohnoliver @jeromelaban @ghuntley
I think we should'nt comment about missing tests, commented code or missing documentation when it's still a draft PR.

I'm not sure I see the point of draft PRs.

@carldebilly

Copy link
Copy Markdown
Member

A draft PR is a way to make sure it's working with CI and get resulting nuget packages for more testing. It's also a way to start a discussion about eventual changes.

@dr1rrb

dr1rrb commented Nov 15, 2019

Copy link
Copy Markdown
Member Author

@davidjohnoliver @jeromelaban @ghuntley
I think we should'nt comment about missing tests, commented code or missing documentation when it's still a draft PR.

I'm not sure I see the point of draft PRs.

In that case it was to get your review on the fonctionnal aspect of this PR, especially as we chat about this specific method in one of your recent PRs :)

@paulovila

paulovila commented Nov 15, 2019 •

Copy link
Copy Markdown

Thanks @dr1rrb , still no joy, I checked out dev/dr/TouchTrans
I overwrote C:\Repos\Uno\src\crosstargeting_override.props
with 2.0.512-dev.9999

generated
C:\Users\pvila.nuget\packages\Uno.UI\2.0.512-dev.9999\lib\netstandard2.0 and C:\Users\pvila.nuget\packages\Uno.UI\2.0.512-dev.9999\ref\netstandard2.0

Still same behaviour buttons do not generate the command
https://github.com/SuperJMN/UnoSimpleCalc

GitHub
Simple calculator. Contribute to SuperJMN/UnoSimpleCalc development by creating an account on GitHub.

@github-actions github-actions Bot added the area/automation Categorizes an issue or PR as relevant to project automation label Nov 15, 2019
@jeromelaban jeromelaban added this to the 2.0 milestone Nov 18, 2019
@dr1rrb dr1rrb mentioned this pull request Nov 18, 2019
2 of 7 tasks
@dr1rrb

dr1rrb commented Nov 18, 2019

Copy link
Copy Markdown
Member Author

Note: this PR only targets WASM, and a issue was opened to multi-target this for other platforms (#2114)

@dr1rrb
dr1rrb marked this pull request as ready for review November 18, 2019 22:06
@dr1rrb dr1rrb added the ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met label Nov 18, 2019
@dr1rrb dr1rrb changed the title Add full support of RenderTransform in TransformToVisual [WASM] Add full support of RenderTransform in TransformToVisual Nov 18, 2019
@dr1rrb

dr1rrb commented Nov 19, 2019

Copy link
Copy Markdown
Member Author

/azp run

1 similar comment
@dr1rrb

dr1rrb commented Nov 19, 2019

Copy link
Copy Markdown
Member Author

/azp run

else
{
// First apply any pending arrange offset that would have been impacted by this RenderTransform (eg. scaled)
// Friendly reminder: Matrix multiplication is usually not commutative ;)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤣

Comment thread src/Uno.UI/UI/Xaml/UIElement.wasm.cs Resolved
Comment thread doc/articles/features/routed-events.md Resolved
@dr1rrb dr1rrb removed the ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met label Nov 19, 2019
Comment thread src/Uno.UI/Uno.UI.csproj Resolved
@dr1rrb dr1rrb added the ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met label Nov 19, 2019
@dr1rrb
dr1rrb merged commit 389ce67 into master Nov 19, 2019
@dr1rrb
dr1rrb deleted the dev/dr/TouchTrans branch November 19, 2019 03:41
MartinZikmund added a commit that referenced this pull request Aug 14, 2026
_skipBaseTypes suppressed the base clause on the generated partial for 51
types "because of legacy mismatched hierarchy". That legacy was the native
view hierarchy, and the 7.0 native drop removed it: UIElement now derives
from DependencyObject and FrameworkElement from UIElement, exactly as WinUI
does, and 41 more entries beneath them fall out with them.

47 entries go: 43 whose Uno base already equals the WinUI base, three that
name types absent from the WinAppSDK 2.1.3 projection or skipped wholesale
elsewhere (Data.CollectionView, Controls.WebView, Controls.UIElementCollection),
and one duplicate (Controls.ComboBox). The four that stay each mask a real
divergence and now say which one.

Regeneration adds a base clause to exactly 43 generated partials, each
naming the type the hand-written partial already derives from, so the
compiled metadata is unchanged. Uno.UI builds clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016ifDe4QKvwkcq5tp4tmxX7
MartinZikmund added a commit that referenced this pull request Aug 20, 2026
_skipBaseTypes suppressed the base clause on the generated partial for 51
types "because of legacy mismatched hierarchy". That legacy was the native
view hierarchy, and the 7.0 native drop removed it: UIElement now derives
from DependencyObject and FrameworkElement from UIElement, exactly as WinUI
does, and 41 more entries beneath them fall out with them.

47 entries go: 43 whose Uno base already equals the WinUI base, three that
name types absent from the WinAppSDK 2.1.3 projection or skipped wholesale
elsewhere (Data.CollectionView, Controls.WebView, Controls.UIElementCollection),
and one duplicate (Controls.ComboBox). The four that stay each mask a real
divergence and now say which one.

Regeneration adds a base clause to exactly 43 generated partials, each
naming the type the hand-written partial already derives from, so the
compiled metadata is unchanged. Uno.UI builds clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016ifDe4QKvwkcq5tp4tmxX7
MartinZikmund added a commit that referenced this pull request Aug 21, 2026
_skipBaseTypes suppressed the base clause on the generated partial for 51
types "because of legacy mismatched hierarchy". That legacy was the native
view hierarchy, and the 7.0 native drop removed it: UIElement now derives
from DependencyObject and FrameworkElement from UIElement, exactly as WinUI
does, and 41 more entries beneath them fall out with them.

47 entries go: 43 whose Uno base already equals the WinUI base, three that
name types absent from the WinAppSDK 2.1.3 projection or skipped wholesale
elsewhere (Data.CollectionView, Controls.WebView, Controls.UIElementCollection),
and one duplicate (Controls.ComboBox). The four that stay each mask a real
divergence and now say which one.

Regeneration adds a base clause to exactly 43 generated partials, each
naming the type the hand-written partial already derives from, so the
compiled metadata is unchanged. Uno.UI builds clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016ifDe4QKvwkcq5tp4tmxX7
MartinZikmund added a commit that referenced this pull request Aug 22, 2026
_skipBaseTypes suppressed the base clause on the generated partial for 51
types "because of legacy mismatched hierarchy". That legacy was the native
view hierarchy, and the 7.0 native drop removed it: UIElement now derives
from DependencyObject and FrameworkElement from UIElement, exactly as WinUI
does, and 41 more entries beneath them fall out with them.

47 entries go: 43 whose Uno base already equals the WinUI base, three that
name types absent from the WinAppSDK 2.1.3 projection or skipped wholesale
elsewhere (Data.CollectionView, Controls.WebView, Controls.UIElementCollection),
and one duplicate (Controls.ComboBox). The four that stay each mask a real
divergence and now say which one.

Regeneration adds a base clause to exactly 43 generated partials, each
naming the type the hand-written partial already derives from, so the
compiled metadata is unchanged. Uno.UI builds clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016ifDe4QKvwkcq5tp4tmxX7
MartinZikmund added a commit that referenced this pull request Aug 28, 2026
_skipBaseTypes suppressed the base clause on the generated partial for 51
types "because of legacy mismatched hierarchy". That legacy was the native
view hierarchy, and the 7.0 native drop removed it: UIElement now derives
from DependencyObject and FrameworkElement from UIElement, exactly as WinUI
does, and 41 more entries beneath them fall out with them.

47 entries go: 43 whose Uno base already equals the WinUI base, three that
name types absent from the WinAppSDK 2.1.3 projection or skipped wholesale
elsewhere (Data.CollectionView, Controls.WebView, Controls.UIElementCollection),
and one duplicate (Controls.ComboBox). The four that stay each mask a real
divergence and now say which one.

Regeneration adds a base clause to exactly 43 generated partials, each
naming the type the hand-written partial already derives from, so the
compiled metadata is unchanged. Uno.UI builds clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016ifDe4QKvwkcq5tp4tmxX7
MartinZikmund added a commit that referenced this pull request Aug 29, 2026
_skipBaseTypes suppressed the base clause on the generated partial for 51
types "because of legacy mismatched hierarchy". That legacy was the native
view hierarchy, and the 7.0 native drop removed it: UIElement now derives
from DependencyObject and FrameworkElement from UIElement, exactly as WinUI
does, and 41 more entries beneath them fall out with them.

47 entries go: 43 whose Uno base already equals the WinUI base, three that
name types absent from the WinAppSDK 2.1.3 projection or skipped wholesale
elsewhere (Data.CollectionView, Controls.WebView, Controls.UIElementCollection),
and one duplicate (Controls.ComboBox). The four that stay each mask a real
divergence and now say which one.

Regeneration adds a base clause to exactly 43 generated partials, each
naming the type the hand-written partial already derives from, so the
compiled metadata is unchanged. Uno.UI builds clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016ifDe4QKvwkcq5tp4tmxX7
MartinZikmund added a commit that referenced this pull request Sep 1, 2026
_skipBaseTypes suppressed the base clause on the generated partial for 51
types "because of legacy mismatched hierarchy". That legacy was the native
view hierarchy, and the 7.0 native drop removed it: UIElement now derives
from DependencyObject and FrameworkElement from UIElement, exactly as WinUI
does, and 41 more entries beneath them fall out with them.

47 entries go: 43 whose Uno base already equals the WinUI base, three that
name types absent from the WinAppSDK 2.1.3 projection or skipped wholesale
elsewhere (Data.CollectionView, Controls.WebView, Controls.UIElementCollection),
and one duplicate (Controls.ComboBox). The four that stay each mask a real
divergence and now say which one.

Regeneration adds a base clause to exactly 43 generated partials, each
naming the type the hand-written partial already derives from, so the
compiled metadata is unchanged. Uno.UI builds clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016ifDe4QKvwkcq5tp4tmxX7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform ready-to-merge Automatically merge the PR once all '.mergify.yml' policies are met

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants