Why the Visual.VisualOffset is double type but run the compositor in floats?
See original GitHub issueWe will use Visual.VisualOffset to set the visual offset. The Visual.VisualOffset is in managed code. And the type of VisualOffset is Vector which is contained the double X and the double Y.
But we will use CMilVisual::ProcessSetOffset
to set it in the MIL code. It will cast the double X and double Y to the float type. Just as the code says, The packet contains doubles. Should they be floats? Why are we using doubles in managed but run the compositor in floats?
Can I know the reason?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Using the Visual Layer with WPF - Windows apps
In this tutorial, you create a simple WPF app UI and add animated Composition elements to it. Both the WPF and Composition components...
Read more >Composition - Ratish Philip's Blog
TKey can be of types – int , float , double or string . TValue should be an object deriving from CompositionObject ....
Read more >MS-RDPCR2-Diff - Composited Remoting V2
Remote Desktop Protocol: Composited Remoting V2 ... Resource Types . ... associated with windows, but they can also be free-floating.
Read more >Composition | Mike Taulty | Page 2
I'm unsure how to get hold of such a mask for arbitrary content but, from the recipes post, a new method has been...
Read more >dotnet 读WPF 源代码笔记布局时Arrange 如何影响元素渲染 ...
我在GitHub 上尝试去问问大佬们,这个是否有特别的原因,请看Why the Visual.VisualOffset is double type but run the compositor in floats?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My guess is because there is no
Vector
struct that holds floats, and all computations and math functions use doubles anyway. GPUs on the other hand can do much faster calculations with floats. Changing either side seems unreasonable, and changing the managed type to use floats - apart from compatibility issues - would move the burden of conversion on the developer (and from native to managed performance).@batzen The question exists in the code as comments. At some point of time, we may circle back to this one as code-review. This issue is practically a duplicate of issue already reported in code.