开发者

Rotated Element creates issues with adorner

开发者 https://www.devze.com 2023-02-08 19:15 出处:网络
I have a problem with my ado开发者_如何学运维rner which is supposed to preview the destination of my drag & drop operation,

I have a problem with my ado开发者_如何学运维rner which is supposed to preview the destination of my drag & drop operation,

everything is working fine until i rotate the adorned element.

My adorner is a rectangle which is filled with a visual brush of the adorned element, so if the element is rotated the adorner gets the correct (already rotated) image. But because the rectangle has to be rotated too the image gets rotated once more which isn't supposed to happen. Can I somehow exclude the brush of the transformation so it will not rotate again or is there another solution for my problem?

Thanks


You can override the GetDesiredTransform method in the adorner class and manipulate the transforms applied to the adorner's children (the rectangle with the visual brush in your case).


Finally I have a solution to this problem: with this small algorythm link I've created a copy of the UI element, set its rendertransform property to null and used it as a visualbrush instead of the original element which also allowed me to set the original element to invisible!

0

精彩评论

暂无评论...
验证码 换一张
取 消