mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-07 17:09:02 +08:00
Fixed minor issue for inheritance button
It didn't always reset to correct value. CURA-1278
This commit is contained in:
parent
a21498c375
commit
a070684ade
@ -185,12 +185,22 @@ Item {
|
|||||||
// Get the deepest entry of this setting that we can find. TODO: This is a bit naive, in some cases
|
// Get the deepest entry of this setting that we can find. TODO: This is a bit naive, in some cases
|
||||||
// there might be multiple profiles saying something about the same setting. There is no strategy
|
// there might be multiple profiles saying something about the same setting. There is no strategy
|
||||||
// how to handle this as of yet.
|
// how to handle this as of yet.
|
||||||
var last_entry = propertyProvider.stackLevels.slice(-1)[0]
|
var last_entry = propertyProvider.stackLevels[propertyProvider.stackLevels.length]
|
||||||
|
|
||||||
|
for (var i = 1; i < base.stackLevels.length; i++)
|
||||||
|
{
|
||||||
|
var has_setting_function = typeof(propertyProvider.getPropertyValue("value", base.stackLevels[i])) == "object";
|
||||||
|
if(has_setting_function)
|
||||||
|
{
|
||||||
|
last_entry = propertyProvider.stackLevels[i]
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
// Put that entry into the "top" instance container.
|
// Put that entry into the "top" instance container.
|
||||||
// This ensures that the value in any of the deeper containers need not be removed, which is
|
// This ensures that the value in any of the deeper containers need not be removed, which is
|
||||||
// needed for the reset button (which deletes the top value) to correctly go back to profile
|
// needed for the reset button (which deletes the top value) to correctly go back to profile
|
||||||
// defaults.
|
// defaults.
|
||||||
if(last_entry == 4 && base.stackLevel == 0)
|
if(last_entry == 4 && base.stackLevel == 0 && base.stackLevels.length == 2)
|
||||||
{
|
{
|
||||||
// Special case of the inherit reset. If only the definition (4th container) and the first
|
// Special case of the inherit reset. If only the definition (4th container) and the first
|
||||||
// entry (user container) are set, we can simply remove the container.
|
// entry (user container) are set, we can simply remove the container.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user