Completely flummoxed over panel value...
-
I have been scratching my head for a couple of hours on this, and I just don't understand!
I am trying to use the panel with the undo system, and here I am getting the old panel value before setting the new panel value, but my old value is always identical to the new value!!!!
The line below the Console prints is
NotationPanel.setPanelValueWithUndo(oldValue, newValue , "set");
This line is the only place in the entire project that is setting the panel value.
There are no other calls to .setPanelValueWithUndo or .setValue.How is it at all possible that NotationPanel.getValue is always returning the new value before it is ever even set?
-
@VirtualVirgin are you able to reproduce the issue in a minimal snippet?
-
@ustk apparently it has to do with transferring an array reference. I tried this
local newValue = scribeData.clone();
instead of this
local newValue = scribeData;
And now it works (the old value is properly being retrieved)...
But I am not quite sure why as I am lost in the puzzle of how the array references operate in this case. -
@VirtualVirgin hard to tell without knowing what
scribeData
is