旋转元素会导致装饰器出现问题

发布于 2024-10-15 23:56:04 字数 211 浏览 8 评论 0原文

我的装饰器有问题,它应该预览我的拖拽和拖拽的目的地。放下操作,

一切正常,直到我旋转装饰元素。

我的装饰器是一个矩形,其中填充了装饰元素的视觉画笔,因此如果旋转该元素,装饰器将获得正确的(已旋转的)图像。但由于矩形也必须旋转,因此图像再次旋转,这是不应该发生的。我可以以某种方式排除变换的画笔,这样它就不会再次旋转吗?或者对于我的问题还有其他解决方案吗?

谢谢

I have a problem with my adorner 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

请持续率性 2024-10-22 23:56:04

您可以重写装饰器类中的 GetDesiredTransform 方法,并操作应用于装饰器子级(在您的情况下带有可视画笔的矩形)的变换。

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).

稀香 2024-10-22 23:56:04

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文