File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 1+ # Extra undo of paint tools crashes live code
Original file line number Diff line number Diff line change @@ -1943,13 +1943,19 @@ void MCMutableImageRep::image_undo(Ustruct *us)
19431943{
19441944 if (state & CS_DRAW)
19451945 return ;
1946-
1947- MCImageFreeBitmap (m_bitmap);
1948- m_bitmap = m_undo_image;
1949- m_undo_image = nil;
1950-
1951- // MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
1952- m_owner->invalidate_rep (rect);
1946+
1947+ // PM-2014-10-01: [[ Bug 13568 ]] Make sure that pressing undo (cmd+z) twice when using paint tools, the second undo undoes the first one.
1948+ MCImageBitmap *t_old_bitmap;
1949+ MCImageCopyBitmap (m_bitmap, t_old_bitmap);
1950+
1951+ MCImageFreeBitmap (m_bitmap);
1952+ m_bitmap = m_undo_image;
1953+ m_undo_image = nil;
1954+ /* UNCHECKED */ MCImageCopyBitmap (t_old_bitmap, m_undo_image);
1955+
1956+ // MW-2011-08-18: [[ Layers ]] Invalidate the whole object.
1957+ m_owner->invalidate_rep (rect);
1958+
19531959}
19541960
19551961void MCMutableImageRep::image_freeundo (Ustruct *us)
You can’t perform that action at this time.
0 commit comments