Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Arggghs.HorizontalChange
Message
From
27/04/2009 03:40:50
 
 
To
All
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Title:
Arggghs.HorizontalChange
Environment versions
Environment:
C# 3.0
Miscellaneous
Thread ID:
01396460
Message ID:
01396460
Views:
102
Hi,

I have a Canvas contained within another Canvas. I'm using an adorner with Thumbs to resize the inner canvas. In the relevant Thumbs DragDelta() I have the usual:
adornedElement.Width = adornedElement.Width + args.HorizontalChange;
and all works as expected. Now I want to Zoom the containing Canvas. If I use a ScaleTransform as the RenderTransform again all is fine. But if I apply this to the LayoutTransform instead (which is my preference) then the DeltaEventArgs.HorizontalChange returns weird values.

As a rough example assume I am (fairly steadily) increasing the width of the inner canvas then tracing the successive HorizontalChange values shows something like: -8,10,-7,16,-15,19,-19,27,-28,35,-38,46,-50 etc. (These are obviously actually double values - I've just rounded them here for readability).

So the absolute values are continually increasing and are alternatively negative/positive.
What can cause this behaviour? What can prevent it?

UPDATE: I've discovered that if I adjust the HorizontalChange based on the current LayoutTransform before adding it to the canvas width then everything is OK. But I must admit I'm unclear as to why this should be neccessary with a LayoutTransform but not with a RenderTransform ?

Thx,
Viv
Reply
Map
View

Click here to load this message in the networking platform