currentVisibleRect doesn't work

bug

#1

Since a recent update this script stopped working, I use it to sync up the cursor position and zoom level between font files:

Font = Glyphs.font

thisTab = Font.currentTab

currentGraphicView = thisTab.graphicView()
currentVisibleRect = currentGraphicView.visibleRect()
currentScale = currentGraphicView.scale()
currentSelectedRange = currentGraphicView.selectedRange()
currentFrameHeight = thisTab.previewHeight
currentMasterIndex =  thisTab.masterIndex()

for eachFont in Glyphs.fonts:
	otherTab = eachFont.currentTab
	otherGraphicView = eachFont.currentTab.graphicView()
	otherGraphicView.setSelectedRange_(currentSelectedRange)
	otherGraphicView.zoomViewToAbsoluteScale_(currentScale)
	otherGraphicView.scrollRectToVisible_(currentVisibleRect)
	otherTab.previewHeight = currentFrameHeight
	otherTab.setMasterIndex_(currentMasterIndex)

Glyphs.redraw()

Seems something with the currentVisibleRect doesn’t work. i.e. if i duplicate a file, and have the same text in a tab, and run the script the view positions do not match up like they used to.


#2

I think this effects @Mark’s sync tab plugin and also @Tosche’s script.


#3

It is not the visibleRect() but the scrollRectToVisible_(). I fixed it.