Information générale
Catégorie:
Windows Presentation Foundation (WPF)
Titre:
Calculating Thumb size in an Adorner
Versions des environnements
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
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement