Skip to content

Commit

Permalink
Fixing more baking issues
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed May 18, 2022
1 parent 56b7327 commit 52fb688
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
7 changes: 6 additions & 1 deletion app/lib/bloc/document_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,9 @@ class DocumentBloc extends ReplayBloc<DocumentEvent, DocumentState> {
.toList();
canvas.scale(pixelRatio);

// Wait one frame
await Future.delayed(const Duration(milliseconds: 1));

ViewPainter(
current.document,
transform: event.cameraTransform,
Expand All @@ -483,8 +486,10 @@ class DocumentBloc extends ReplayBloc<DocumentEvent, DocumentState> {
var currentRenderers = current.cameraViewport.unbakedElements;
if (reset) {
currentRenderers = current.renderers;
} else {
renderers.addAll(current.cameraViewport.bakedElements);
}
currentRenderers
currentRenderers = currentRenderers
.whereNot(
(element) => invisibleLayers.contains(element.element.layer))
.whereNot((element) => renderers.contains(element))
Expand Down
10 changes: 9 additions & 1 deletion app/lib/views/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,15 @@ class _MainViewViewportState extends State<MainViewViewport> {
: Offset(-dx, -dy))
..zoom(scale, pointerSignal.localPosition);
}
_bake(cubit.state);
final currentSize =
context.read<TransformCubit>().state.size;
Future.delayed(const Duration(milliseconds: 500), () {
if (currentSize ==
context.read<TransformCubit>().state.size &&
currentSize != state.cameraViewport.scale) {
_bake();
}
});
}
},
onPointerDown: (PointerDownEvent event) {
Expand Down
19 changes: 11 additions & 8 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ module.exports = {
position: 'left'
},
{
to: 'community',
type: 'doc',
docId: 'community',
docsPluginId: 'community',
position: 'left',
label: 'Community',
},
{
Expand Down Expand Up @@ -198,20 +201,19 @@ module.exports = {
],
],
plugins: [
[
'@docusaurus/plugin-client-redirects',
{
redirects: redirects
},
],
[
'@docusaurus/plugin-content-docs',
{
id: 'community',
path: 'community',
routeBasePath: '/',
sidebarPath: require.resolve('./sidebarsCommunity.js')

},
],
[
'@docusaurus/plugin-client-redirects',
{
redirects: redirects
},
],
[
Expand Down Expand Up @@ -241,5 +243,6 @@ module.exports = {
],
},
],
// Other tweaks
]
};
3 changes: 2 additions & 1 deletion fastlane/metadata/android/en-US/changelogs/22.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
* Add tooltips on window buttons
* Disable window buttons in full screen
* Fix file system on web (Creating directory if not exist)#
* Fix file system directory error
* Fix file system directory error
* Fix baking issues

0 comments on commit 52fb688

Please sign in to comment.