SyntaxEditor and ActiveView's ZoomLevel are out of sync

SyntaxEditor for WPF Forum

Posted 3 years ago by Sunshine - Appeon
Version: 21.1.1
Avatar

I bind all the ZoomLevel properties of SyntaxEditor to a common variable to achieve unification. But when I opened a new window, I found that SyntaxEditor and its ActiveView have different ZoomLevel values. This resulted in the view not scrolling to the expected position when I was doing some navigation functions.

When the ZoomLevels of all SyntaxEditors are unified in this way, there will be an obvious animation process when switching SyntaxEditor. It seems to be synchronizing the ZoomLevel of SyntaxEditor and ActiveView.

Comments (3)

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

If you'd like us to look into this, please put together a new simple sample project that shows it happening and send it to our support address, referencing this thread.  Make sure you exclude the bin/obj folders from the .zip you send so that it doesn't get spam blocked.  Thanks!


Actipro Software Support

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Thank you for the sample.  The problem seems to be because the ActiveView.ZoomLevel is animated over time when SyntaxEditor.ZoomLevel updates, your code is executing before the zoom level animation completes and thus the scroll position ends up being off.  For the next build, we will update the SyntaxEditor.ZoomLevel property changed handler logic to change the value immediately (instead of over time) when the SyntaxEditor isn't loaded.  That seems to resolve the issue in your sample.


Actipro Software Support

Posted 3 years ago by Sunshine - Appeon
Avatar

When I set the value of ZoomAnimationDuration to 0, the case I sent to you shows that SyntaxEditor is synchronized with the ZoomLevel of ActiveView. But it doesn't seem to be absolute.

I operate in our actual project. Even if ZoomAnimationDuration is 0, there are occasions when ZoomLevel is out of sync.

I think some time-consuming operations in the middle may affect this process.

But as you said, synchronizing the value immediately when the SyntaxEditor is not loaded should solve this problem.

Thank for your help!

The latest build of this product (v24.1.3) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.