Skip to content

Commit

Permalink
fix: toggle visible
Browse files Browse the repository at this point in the history
  • Loading branch information
F-star committed Oct 22, 2023
1 parent 589cb8a commit bce9eed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/suika/src/editor/service/mutate_graphs_and_record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ export const MutateGraphsAndRecord = {
return;
}

const newVisible = !graphs.some((item) => item.visible);
// if at least one graph is hidden, show all graphs; otherwise, hide all graphs
const newVisible = graphs.some((item) => !item.getVisible());
const prevAttrs = graphs.map((el) => ({ visible: el.visible }));
graphs.forEach((el) => {
el.visible = newVisible;
Expand All @@ -153,7 +154,7 @@ export const MutateGraphsAndRecord = {
return;
}

const newLock = !graphs.some((item) => item.lock);
const newLock = !graphs.some((item) => item.getLock());
const prevAttrs = graphs.map((el) => ({ lock: el.lock }));
graphs.forEach((el) => {
el.lock = newLock;
Expand Down

0 comments on commit bce9eed

Please sign in to comment.