Set and Sync Preview Panel Sizes

Ok…finally switching to G3… I use to have a script for syncing the preview panel sizes:

but now it doesn’t work:

Traceback (most recent call last):
  File "Set Same View Position for This Tab.py", line 26
    otherTab.frameView().zoomViewToRect_(currentVisibleRect)
AttributeError: 'NSKVONotifying_GSFrameView' object has no attribute 'zoomViewToRect_'

There are two new methods:

this one zooms so that the rect is not covered below the info view:

frameView.zoomViewToSaveRect_(rect)

this is zooming into the full view:

frameView.zoomViewToVisibleRect_(rect)

Thanks for that Georg, even when I use the new method the synching doens’t work (the scale is correct but the view position doesn’t sync), it sometimes syncs up but most the time it’s offset by a lot:

It worked perfectly in G2 but not anymore.
Also synching the preview panel is off by about 1 unit height it seems when I run the script, i.e. if I take the previewHeight from the currentTab and apply it to another tab, the result is 1 unit less.

The other thing I’d like to sync is the horizontal position of what’s being displayed in the preview panel, is this possible through a script. Or even just a setting to reset it to 0 offset.

You can see in this video, that in G2 the script syncs the preview panel size and the view position in the edit view correctly, whereas in G3, the preview panel is slightly off and the position in the edit view is always off:

I have answered that in the git issue.

Thanks Georg, does this solve the edit view offset issue where the following code doesn’t sync consistently (see above video):
otherTab.frameView().zoomViewToVisibleRect_(currentVisibleRect)

I’m a bit confused. Can we move that discussion to GitHub with one issue per problem.