Resizing an image can't be undone

• Jan 28, 2019 - 19:34
Reported version
3.0
Type
Functional
Frequency
Once
Severity
S4 - Minor
Reproducibility
Always
Status
active
Regression
No
Workaround
No
Project
  1. place an image
  2. double click to edit
  3. resize
  4. deselect image
  5. undo: the image is removed.

Expected: the original size is restored. [EDIT: actually, it is restored to a infinitely small (garbage) size]

This is somewhat related to issue #282862: Moving an image can't be undone, but instead is due to Image::endEditDrag reading garbage from ed.getData [EDIT: and casting it to ImageEditData]


Comments

Yes. I can reproduce the bug both with the official Musescore 2.3.2 AppImage from the website, and with my self-built musescore 2.3.2.

Talking about musescore 3, at image.cpp:414, ed.getData(this) should retrieve the "ImageEditData" object allocated at image.cpp:371, but it retrieves some other object.
So i temporarily fixed that for my build with an ugly workaround; I verified that it receives the correct object; however, even when getting the correct object and invoking correctly score()->undoPropertyChanged, still "undo" makes the image disappear. This is not related to issue #283066: "Image" element anchored to measure disappears after save and reopen since that is a proper regression.