Prevent rendering incorrectly in editor on first load if custom font is used (sketch theme)

This commit is contained in:
David Evans 2018-01-12 20:45:06 +00:00
parent 819d51f856
commit f0cb8e0ca5
1 changed files with 4 additions and 1 deletions

View File

@ -313,7 +313,10 @@ define(['require'], (require) => {
this.viewPaneInner.appendChild(this.diagram.dom()); this.viewPaneInner.appendChild(this.diagram.dom());
this.registerListeners(); this.registerListeners();
this.update();
// Delay first update 1 frame to ensure render target is ready
// (prevents initial incorrect font calculations for custom fonts)
setTimeout(this.update.bind(this), 0);
} }
addCodeBlock(block) { addCodeBlock(block) {