General information
Category:
Windows Presentation Foundation (WPF)
Title:
Calculating Thumb size in an Adorner
Hi,
I have a Canvas containing various nested FrameworkElements (no predefined nesting limit but in practice it should not exceed a depth of, say, four)
where each elemement may have its own RenderTransform applied.
When an Adorner is added to a nested element it, of course, inherits (not strictly the right term - but you know what I mean) the RenderTransform of its associated element - including the transforms imposed by each of the elements ancestors.
All this is fine in that the Adorners thumbs will be rotated correctly and can easily be located as required over the AdornedElement. Obviously, however, I don't want the actual thumb size to be *scaled* to the AdornedElement.
I've seen references to using the Adorner.GetDesiredTransform() but I don't see how this would help in this situation since I need to 'unscale' the thumb size all the way up to the form level.
If rotation wasn't involved I could easily work out the total scaling factor between the selected element and the 'top level' using a TranslatePoint() call. Even with rotation I suppose I could do this using trig.
But does anyone have a better suggestion ?
Regards,
Viv
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only