mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 03:05:59 +08:00
Fix double undo/redo snapshot when using SpinCtrl
This commit is contained in:
parent
60894a26dd
commit
48e1919ff1
@ -877,10 +877,10 @@ void SpinCtrl::BUILD() {
|
|||||||
|
|
||||||
void SpinCtrl::propagate_value()
|
void SpinCtrl::propagate_value()
|
||||||
{
|
{
|
||||||
if (suppress_propagation)
|
// check if value was really changed
|
||||||
|
if (boost::any_cast<int>(m_value) == tmp_value)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
suppress_propagation = true;
|
|
||||||
if (tmp_value == UNDEF_VALUE) {
|
if (tmp_value == UNDEF_VALUE) {
|
||||||
on_kill_focus();
|
on_kill_focus();
|
||||||
} else {
|
} else {
|
||||||
@ -894,7 +894,6 @@ void SpinCtrl::propagate_value()
|
|||||||
#endif
|
#endif
|
||||||
on_change_field();
|
on_change_field();
|
||||||
}
|
}
|
||||||
suppress_propagation = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpinCtrl::msw_rescale()
|
void SpinCtrl::msw_rescale()
|
||||||
|
@ -302,7 +302,6 @@ class SpinCtrl : public Field {
|
|||||||
private:
|
private:
|
||||||
static const int UNDEF_VALUE = INT_MIN;
|
static const int UNDEF_VALUE = INT_MIN;
|
||||||
|
|
||||||
bool suppress_propagation {false};
|
|
||||||
public:
|
public:
|
||||||
SpinCtrl(const ConfigOptionDef& opt, const t_config_option_key& id) : Field(opt, id), tmp_value(UNDEF_VALUE) {}
|
SpinCtrl(const ConfigOptionDef& opt, const t_config_option_key& id) : Field(opt, id), tmp_value(UNDEF_VALUE) {}
|
||||||
SpinCtrl(wxWindow* parent, const ConfigOptionDef& opt, const t_config_option_key& id) : Field(parent, opt, id), tmp_value(UNDEF_VALUE) {}
|
SpinCtrl(wxWindow* parent, const ConfigOptionDef& opt, const t_config_option_key& id) : Field(parent, opt, id), tmp_value(UNDEF_VALUE) {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user