Skip to content

Commit

Permalink
Fix baking issues
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed May 18, 2022
1 parent 68ac0e5 commit 56b7327
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/lib/bloc/document_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,8 @@ class DocumentBloc extends ReplayBloc<DocumentEvent, DocumentState> {
currentRenderers = current.renderers;
}
currentRenderers
.where((element) => !invisibleLayers.contains(element.element.layer))
.toList();
currentRenderers = currentRenderers
.whereNot(
(element) => invisibleLayers.contains(element.element.layer))
.whereNot((element) => renderers.contains(element))
.toList();
emit(current.copyWith(
Expand Down Expand Up @@ -598,7 +597,9 @@ class DocumentBloc extends ReplayBloc<DocumentEvent, DocumentState> {
saved: false,
document: current.document.copyWith(updatedAt: DateTime.now()),
cameraViewport: unbakedElements == null
? current.cameraViewport.unbake(elements)
? current.cameraViewport.unbake(
List<Renderer<PadElement>>.from(elements)
..addAll(current.cameraViewport.bakedElements))
: current.cameraViewport.withUnbaked(elements));
if (current.embedding != null) {
emit(nextState);
Expand Down

0 comments on commit 56b7327

Please sign in to comment.