-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interference with other Plugin(s) #33
Comments
It might be related to assigning the current window controller for each drawing operation. And with the mouse moved callbacks from Red Arrows that might get called in the wrong order or is overwriting things. |
Thanks! Is there anything I can improve on my side? I am currently fixing the currentFontDocument handling. Maybe a way of checking for the correct window controller in my drawing operations? |
I would need to check the code that access the the fonts. |
It’s quite hard to describe. I’ll clean up the messy code a bit and then will show you. Basically when it works weidly, the live update on slider changes of the drawing happens only in the first opened font document, but only updates after a slider changed and the mouse is let go in all other font documents. Then, when I enable Red Arrows, the same happens. But when I then disable RA, and wiggle around the sliders, the live update works well in all open documents. |
If I remember correctly, Georg optimized a part of my code so that the outline check doesn't need to be updated that often. I vaguely remember that I had similar experiences as you, @Mark2Mark, in that the updating and the live showing/hiding of error labels works more reliably when it is once deactivated (context menu: Show Error Labels), then activated again. I never really found out what causes this. Sorry that I can't be of more help ... |
Don’t worry. That helps already a bit in that it seems that I am not alone with this experience. Will further investigate. Thanks so much for both of your helps. |
Adding some investigation. As it seemed to "fix" VFP when RA is enabled and disabled again, we thought to start looking into the willDeactivate method. There RA calls Interesting is, that The RA observer of interest here is Note: "odd" behaving VFP means, that the drawings in the EditView don’t live update in any but the first opened font, when there are several fonts open. In all other fonts, the drawing only updates when the user releases a slider after moving it. "fixed" means, all fonts show live updating drawings in their EditViews. |
Last discovery from Georg’s tip: def mouseDidMove_(self, notification):
pass # Glyphs.redraw() makes VFP work entirely as expected. Georg has enough information now to look into it. But it’s not a high priority, so we can leave this just as a reminder here for later. |
can you try this in the mouseDidMove_: def mouseDidMove_(self, notification):
try:
notification.object().window().windowController().activeEditViewController().graphicView().setNeedsDisplay_(True)
except Exception as e:
import traceback
print(traceback.format_exc()) It will only redraw the edit view that the mouse is over. So it might avoid the tow fonts problem. (that we should fix, too). |
🍀 This w❤️rks like a charm 🍀 |
I've added @schriftgestalt’s suggestion to my code (93bd4ff). Thank you! |
Thank you too! |
Sometimes I had users reporting, that my Variable Font Preview goes a little loco when the Red Arrows Plugin is also active.
I could now reproduce this while improving management of multiple fonts. Once Red Arrows is active, VFP can only deal with the first open font well. Wenn switching to another font, the redrawing gets very glitchy.
@jenskutilek do you happen to have an idea what part of Red Arrows could potentially cause other plugins to be affected in a way or another?
VFP is written in objc and I am prefixing all my classes. Currently I am rather clueless.
Edit: It is even more curious: When I launch Glyphs with Red Arrows off, VFP also behaves odd in some spots, then I turn RA on, and it keeps odd, but when turning RA off then, all is fine. :D
Not blaming your code at all. Just wanted add it for the record …
The text was updated successfully, but these errors were encountered: