Hi! I’m trying to add some info to go next to tab’s info view; can I ask what’s the best way to do that, how to get its position on the screen?
tab.viewPort.origin to calculate the position, but it seems like a long way around and the text is jumpy because of the rounding.
tab.graphicView().infoView().bounds.origin is always (0, 0), so that’s doesn’t help either. Am I overlooking something obvious?
What do you try to put there?
Or use the insectorView API to add your own info box.
Thank you, that’s much better!
Almost there, just showing the angle:
However, in Glyphs 2 one can add a GSInspectorView to the panel with view method, but it doesn’t work in Glyphs 3. Is it different now?
Also, is there a way to change its position relative to the main panel? I’d put it above the width/height rather than on the right.
FYI that should be
Font.currentTab.infoView().frame() (or with your tab variable
you need to return an NSViewController.
What class and superclass is
I found that in your
comment from a couple of years ago. So, self is ReporterPlugin, pretty much the same code.
Any hints on how to return NSViewController, please? Can’t find it among properties of anything.
viewController = NSViewController.new()
You should store that viewController in a local variable that you can reuse it.
Oh I see, thank you! But seems like that crashes Glyphs
Can you send me the full code (privately if needed)?
Sure, I was going to submit it for Plugin Manager anyway:
By the way, if you can explain how to position it at some coordinates above the default panel rather then next to it, I think it would look better
You know that there is a plugin that does something similar:
GitHub - Mark2Mark/Show-Distance-And-Angle-Of-Nodes
Of course, I just prefer such secondary info to blend with the interface rather than sit right on top of paths
That plugin has sadly been broken since 3.2, I miss it dearly
I fixed the Distance and Angle plugin.
Any hints on that error, please?
view method has to return a view, not a view controller. My code snippet would need to go into
inspectorViewControllersForLayer_(). But your hack to return
[self] works, too. I fixed the code but can’t push the changes. Can you add me to the repo?