I’m trying to update from GoXam 1.2 to 1.3 and am using the new DiagramPanel.ZoomToFit() method. I’m seeing two problems in my Silverlight application:
- The ZoomToFit call results in jumpy animation. Starting with a diagram that has a scale less than 1.0, it looks like the ZoomToFit call (with no parameters) does the following:
- Translate diagram to upper left corner - Clear drawing surface - Position diagram at center of panel - Increase scale using an animation
The initial translation to the upper left corner makes it look a bit jumpy. Is there anything I can do about this effect?
- When starting with a diagram at a very small scale (say, 0.1) which is positioned in the center of the visible area, a call to ZoomToFit() often results in a diagram which is off center. Usually the upper left quadrant of the diagram is all that is visible – the user has to pan around to see the remainder. The scale is pretty close (if not absolutely correct). Interestingly, I get the same behavior from my old manual calculation code:
var heightRatio = panel.ActualHeight / panel.DiagramBounds.Height;
var widthRatio = panel.ActualWidth / panel.DiagramBounds.Width;
var ratioToUse = Math.Min(heightRatio, widthRatio);
panel.SetScaleAndPosition(ratioToUse, new Point(0,0), 500, null);
Is there anything I can do to manually correct this situation?
edit: BTW, your GoXam online samples are giving an HTTP 404 again (using address http://www.goxam.com/1.3/Silverlight/GoSilverlightDemo.html).