Skip to content

Commit

Permalink
0.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
zsviczian committed Aug 14, 2022
1 parent a174a77 commit 0f86d9b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "excalibrain",
"name": "ExcaliBrain",
"version": "0.1.6",
"minAppVersion": "0.15.5",
"version": "0.1.7",
"minAppVersion": "0.15.6",
"description": "A clean, intuitive and editable graph view for Obsidian",
"author": "Zsolt Viczian",
"authorUrl": "https://zsolt.blog",
Expand Down
9 changes: 9 additions & 0 deletions src/Scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export class Scene {
public vaultFileChanged: boolean = false;
public pinLeaf: boolean = false;
public focusSearchAfterInitiation: boolean = true;
private zoomToFitOnNextBrainLeafActivate: boolean = false; //this addresses the issue caused in Obsidian 0.16.0 when the brain graph is rendered while the leaf is hidden because tab is not active

constructor(plugin: ExcaliBrain, newLeaf: boolean, leaf?: WorkspaceLeaf) {
this.ea = plugin.EA;
Expand Down Expand Up @@ -304,6 +305,7 @@ export class Scene {
});
}


private async render() {
if(this.historyPanel) {
this.historyPanel.rerender()
Expand All @@ -319,6 +321,8 @@ export class Scene {

const ea = this.ea;

this.zoomToFitOnNextBrainLeafActivate = !ea.targetView.containerEl.isShown();

ea.clear();
ea.getExcalidrawAPI().updateScene({elements:[]});
ea.style.verticalAlign = "middle";
Expand Down Expand Up @@ -609,8 +613,13 @@ export class Scene {

if (rootFile.path === self.ea.targetView.file.path) { //brainview drawing is the active leaf
if(this.vaultFileChanged) {
this.zoomToFitOnNextBrainLeafActivate = false;
await this.reRender(true);
}
if(this.zoomToFitOnNextBrainLeafActivate) {
this.zoomToFitOnNextBrainLeafActivate = false;
self.ea.getExcalidrawAPI().zoomToFit(null, 5, 0.15);
}
self.blockUpdateTimer = false;
return;
}
Expand Down
1 change: 1 addition & 0 deletions versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"0.1.7": "0.15.6",
"0.1.6": "0.15.5",
"0.1.3": "0.15.3",
"0.1.0": "0.15.2",
Expand Down

0 comments on commit 0f86d9b

Please sign in to comment.