From 56b73278a8257292d8e1ce8f25c6daabc437335f Mon Sep 17 00:00:00 2001 From: CodeDoctorDE Date: Wed, 18 May 2022 08:30:01 +0200 Subject: [PATCH] Fix baking issues --- app/lib/bloc/document_bloc.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/lib/bloc/document_bloc.dart b/app/lib/bloc/document_bloc.dart index 11bc54d173ec..35426017bfb9 100644 --- a/app/lib/bloc/document_bloc.dart +++ b/app/lib/bloc/document_bloc.dart @@ -485,9 +485,8 @@ class DocumentBloc extends ReplayBloc { 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( @@ -598,7 +597,9 @@ class DocumentBloc extends ReplayBloc { saved: false, document: current.document.copyWith(updatedAt: DateTime.now()), cameraViewport: unbakedElements == null - ? current.cameraViewport.unbake(elements) + ? current.cameraViewport.unbake( + List>.from(elements) + ..addAll(current.cameraViewport.bakedElements)) : current.cameraViewport.withUnbaked(elements)); if (current.embedding != null) { emit(nextState);