Viewbox 'Nan' Error when ZoomPanel loaded with content at ZoomFactor greater than 1.0
#1
We have a Zoom Panel in a ScrollViewer and when the zoom panel is loaded with content that causes it use a zoom factor greater that 1.0 and the thumbnails appear on the scroll bars the vertical scrollbar has the offset and thumbnail size incorrectly set. If you click the up or down buttons on the scrollbar or call any of the vertical related methods, such as LineDown, LineUp, SetVerticalOffset method you get an error like

'0.1,NaN,0.8,0.8' is not a valid value for property 'Viewbox'.

You can trigger this error with the ZoomPanel samples.  Load the application and go to the Other Methods page and make sure the first button you click is one of the following:

LineUp, LineDown, MouseWheelUp, MouseWheelDown, PageUp, PageDown or SetVerticalOffset

This will all trigger the error.  However if you chose one of the other options first then click one of the above no error is thrown. For example click any of the horizontal related methods first and then one of the vertical ones and it is fine.

If you modify the sample to put a scrollviewer around the ZoomPanel you will notice the vertical scrollbar has an incredibly small thumbnail and is at the top of the scrollbar.

This doesn't occur in the ScrollViewer sample because the initial zoom factor is not greater than 1.0.  In the set methods page you can see the image is larger that the view port and so the initial zoom factor is greater than 1.

If you set the ZoomFactor of the ZoomPanel to a value greater than 1 in the constructor of the ScrollViewer sample you will get the error.  If you set the zoom factor in Loaded event it is fine.  Regardless of where you set the Zoom Factor the Horizontal scrollbar always works fine.
#2
Thank you for your detailed error report.

I was able to find the case of the problem in calculating the aspect ratio before the size of the control was known - this produced a NaN value that was then propagated further on until an exception was thrown.

Though the ZoomPanel control has only limited support and will not receive any new major versions, I decided to fix that error and release a new version with that fix.

You can get the new NetGet or download the new commercial / evaluation installer.
Andrej Benedik
#3
Thank you very much for the quick response and fix.  Great product and excellent service.
  


Forum Jump:


Users browsing this thread:
1 Guest(s)