Skip to content

Commit

Permalink
Fix invisible layers setting being ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Sep 26, 2024
1 parent 052cd13 commit 24cecec
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

| Version | Supported | |
| ------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| 2.2-dev | :warning: | [Docs](https://butterfly.linwood.dev/docs/2.1/intro) [Release](https://github.com/LinwoodDev/butterfly/releases/tag/v2.2.0-rc.1) |
| 2.2-dev | :warning: | [Docs](https://butterfly.linwood.dev/docs/2.1/intro) [Release](https://github.com/LinwoodDev/butterfly/releases/tag/v2.2.0-rc.2) |
| 2.1.1 | :white_check_mark: | [Docs](https://butterfly.linwood.dev/docs/2.1/intro) [Release](https://github.com/LinwoodDev/butterfly/releases/tag/v2.1.1) |
| 2.0.3 | :x: | [Docs](https://butterfly.linwood.dev/docs/2.0/intro) [Release](https://github.com/LinwoodDev/butterfly/releases/tag/v2.0.3) |
| 1.6.1 | :x: | [Docs](https://butterfly.linwood.dev/docs/1.6/intro) [Release](https://github.com/LinwoodDev/butterfly/releases/tag/v1.6.1) |
Expand Down
6 changes: 3 additions & 3 deletions app/lib/view_painter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ class ViewPainter extends CustomPainter {
final CameraViewport cameraViewport;
final CameraTransform transform;
final ColorScheme? colorScheme;
final Set<String> invisibleCollections;
final Set<String> invisibleLayers;
final Map<String, RendererState> states;

const ViewPainter(
this.document,
this.page,
this.info, {
this.currentArea,
this.invisibleCollections = const {},
this.invisibleLayers = const {},
this.states = const {},
this.renderBackground = true,
this.renderBaked = true,
Expand Down Expand Up @@ -169,7 +169,7 @@ class ViewPainter extends CustomPainter {
canvas.translate(-transform.position.dx, -transform.position.dy);
for (final renderer in cameraViewport.unbakedElements) {
final state = states[renderer.id];
if (!invisibleCollections.contains(renderer.element.collection) &&
if (!invisibleLayers.contains(renderer.layer) &&
state != RendererState.hidden) {
final center = renderer.rect?.center;
final radian = renderer.rotation * (pi / 180);
Expand Down
2 changes: 1 addition & 1 deletion app/lib/views/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ class _MainViewViewportState extends State<MainViewViewport>
state.info,
cameraViewport: currentIndex.cameraViewport,
transform: frictionTransform,
invisibleCollections: state.invisibleLayers,
invisibleLayers: state.invisibleLayers,
states: currentIndex.allRendererStates,
currentArea: state.currentArea,
colorScheme: Theme.of(context).colorScheme,
Expand Down
4 changes: 2 additions & 2 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1118,10 +1118,10 @@ packages:
dependency: "direct main"
description:
name: printing
sha256: de1889f30b34029fc46e5de6a9841498850b23d32942a9ee810ca36b0cb1b234
sha256: b576764370c920b510cedf3eac7dc199d6d4af34336d608e97546392c0113362
url: "https://pub.dev"
source: hosted
version: "5.13.2"
version: "5.13.3"
process:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions metadata/en-US/changelogs/115.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
* Fix current layer not being changed
* Fix lock collection mode not working
* Fix elements being modifyable in different layers
* Fix invisible layers setting being ignored

Read more here: https://linwood.dev/butterfly/2.2.0-rc.2

0 comments on commit 24cecec

Please sign in to comment.