Skip to content

Commit

Permalink
Fix broken Opacity slider in Layers panel (#2004)
Browse files Browse the repository at this point in the history
Fix Opacity slider in Layers panel adding Transactions on_update and add Transactions when on_commit
  • Loading branch information
singhutsav5502 authored Sep 23, 2024
1 parent 8a10899 commit b57c53a
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -974,12 +974,7 @@ impl MessageHandler<DocumentMessage, DocumentMessageData<'_>> for DocumentMessag
}
DocumentMessage::SetOpacityForSelectedLayers { opacity } => {
let opacity = opacity.clamp(0., 1.);
let mut added_transaction = false;
for layer in self.network_interface.selected_nodes(&[]).unwrap().selected_layers_except_artboards(&self.network_interface) {
if !added_transaction {
responses.add(DocumentMessage::AddTransaction);
added_transaction = true;
}
responses.add(GraphOperationMessage::OpacitySet { layer, opacity });
}
}
Expand Down Expand Up @@ -1942,6 +1937,7 @@ impl DocumentMessageHandler {
Message::NoOp
}
})
.on_commit(|_| DocumentMessage::AddTransaction.into())
.widget_holder(),
//
Separator::new(SeparatorType::Unrelated).widget_holder(),
Expand Down

0 comments on commit b57c53a

Please sign in to comment.