Skip to content
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

[Proxy] Glyph and Font .update() #77

Open
kateliev opened this issue Jan 13, 2023 · 0 comments
Open

[Proxy] Glyph and Font .update() #77

kateliev opened this issue Jan 13, 2023 · 0 comments
Assignees
Labels
Core TypeRig Core Easy fix A very minor bug that is easily fixable, but over-missed.

Comments

@kateliev
Copy link
Owner

As discussed with Yury i need to check and refactor my object update routines. Some of the api calls used so far are way to expensive and in the wrong order.

...there is AcceptChanges, UpdateActiveCanvas and UpdateAll.
AcceptChanges will update data without refresh. It has optional bool parameter that if it is true, then it updates and forgets about changes if false (default) it updates, but UpdateAll will refresh everything anyway...
UpdateActiveCanvas is good, will work on current GW only and it will call AcceptChanges(true)

... calling notifyGlyphUpdated with some package id, but with glyph id == 0, means that ALL glyphs should be updated in FW, preview panel, etc. You may also have a call notifyGlyphsUpdated and provide a list of glyph's fgId. This should be that's FINAL call - you call it when operation is DONE (when mouse is released). Same is true for notifyChangesApplied, it is final call it triggers undo system which is expensive...

fl6.flitems.notifyGlyphUpdated(glyph.package.fgId(), glyph.fgGlyphId())

In many cases you may prefer to call AcceptChanges with parameter or without it. If you know, you will call for notifyChangesApplied and notifyGlyphUpdated at the end (which will redraw GW). You may use AcceptChanges(true) if you don't need to refresh GW content. If you know you have active GW, try to call UpdateActiveCanvas. If in doubt, call UpdateAll, it will refresh data and also refresh GW.

... flPreferences::editorFastPreview() ...
...if editorFastPreview is true, then UpdateAll should also mean notifyGlyphUpdated...

@kateliev kateliev added Easy fix A very minor bug that is easily fixable, but over-missed. Core TypeRig Core labels Jan 13, 2023
@kateliev kateliev self-assigned this Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core TypeRig Core Easy fix A very minor bug that is easily fixable, but over-missed.
Projects
None yet
Development

No branches or pull requests

1 participant