replace default reference captures, fix missing calls (#1153)

* forAll -> forEach

* replace default reference captures with more specific ones

* fix missing calls in fixXYZ/forEachSelectedWithRefresh
This commit is contained in:
Dennis Brakhane
2025-07-08 17:08:59 +02:00
committed by GitHub
parent 38caf1a5f0
commit 282b81c3d9
26 changed files with 452 additions and 452 deletions
+4 -4
View File
@@ -56,8 +56,8 @@ void LayerWindow::Create(EditorComponent* _editor)
AddWidget(&layers[i]);
}
auto forEachLayer = [&] (auto func) {
return [&, func] (auto args) {
auto forEachLayer = [this] (auto func) {
return [this, func] (auto args) {
wi::scene::Scene& scene = editor->GetCurrentScene();
for (auto& x : editor->translator.selected)
{
@@ -75,13 +75,13 @@ void LayerWindow::Create(EditorComponent* _editor)
};
enableAllButton.Create("ALL " ICON_CHECK);
enableAllButton.OnClick(forEachLayer([&] (auto layer, auto args) {
enableAllButton.OnClick(forEachLayer([] (auto layer, auto args) {
layer->layerMask = ~0;
}));
AddWidget(&enableAllButton);
enableNoneButton.Create("NONE " ICON_DISABLED);
enableNoneButton.OnClick(forEachLayer([&] (auto layer, auto args) {
enableNoneButton.OnClick(forEachLayer([] (auto layer, auto args) {
layer->layerMask = 0;
}));
AddWidget(&enableNoneButton);