Skip to content

Commit

Permalink
Fixed a crash when undoing after a drag operation
Browse files Browse the repository at this point in the history
  • Loading branch information
ffAudio committed Sep 13, 2021
1 parent 6b3d657 commit 7c28c5d
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Editor/foleys_StyleBoolPropertyComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,14 @@ void StyleBoolPropertyComponent::refresh()
if (auto* toggle = dynamic_cast<juce::ToggleButton*>(editor.get()))
{
if (node == inheritedFrom)
{
toggle->getToggleStateValue().referTo (node.getPropertyAsValue (property, &builder.getUndoManager()));
}
else
{
toggle->getToggleStateValue().referTo (toggle->getToggleStateValue());
toggle->setToggleState (value, juce::dontSendNotification);
}
}

repaint();
Expand Down
5 changes: 5 additions & 0 deletions Editor/foleys_StyleChoicePropertyComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,14 @@ void StyleChoicePropertyComponent::refresh()
if (auto* combo = dynamic_cast<juce::ComboBox*>(editor.get()))
{
if (node == inheritedFrom)
{
proxy.referTo (node.getPropertyAsValue (property, &builder.getUndoManager()));
}
else
{
proxy.referTo (proxy);
combo->setText (value.toString(), juce::dontSendNotification);
}
}

repaint();
Expand Down
1 change: 1 addition & 0 deletions Editor/foleys_StyleColourPropertyComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ void StyleColourPropertyComponent::refresh()
if (value.isVoid())
getLookAndFeelColourFallback();

label->getTextValue().referTo (label->getTextValue());
label->setText (value.toString(), juce::dontSendNotification);
}
}
Expand Down
1 change: 1 addition & 0 deletions Editor/foleys_StyleGradientPropertyComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ void StyleGradientPropertyComponent::refresh()
}
else
{
label->getTextValue().referTo (label->getTextValue());
label->setText (value.toString(), juce::dontSendNotification);
}
}
Expand Down
5 changes: 5 additions & 0 deletions Editor/foleys_StyleTextPropertyComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,14 @@ void StyleTextPropertyComponent::refresh()
if (auto* label = dynamic_cast<juce::Label*>(editor.get()))
{
if (node == inheritedFrom)
{
label->getTextValue().referTo (node.getPropertyAsValue (property, &builder.getUndoManager()));
}
else
{
label->getTextValue().referTo (label->getTextValue());
label->setText (value.toString(), juce::dontSendNotification);
}
}

repaint();
Expand Down
2 changes: 2 additions & 0 deletions VERSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ PluginGuiMagic - Versions history
1.3.5
-----

- Fixed AlertWindow::IconType to a backward compatible version
- Add ParameterAttachment for Label
- Added a fix when undo after a edit-drag operation

1.3.4 - 01.08.2021
------------------
Expand Down
2 changes: 1 addition & 1 deletion foleys_gui_magic.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
ID: foleys_gui_magic
vendor: Foleys Finest Audio
version: 1.3.3
version: 1.3.5
name: Foleys GUI magic
description: This module allows to create GUI with a drag and drop editor
dependencies: juce_core, juce_audio_basics, juce_audio_devices, juce_audio_formats,
Expand Down

0 comments on commit 7c28c5d

Please sign in to comment.