MCPcopy Create free account
hub / github.com/LibreSprite/LibreSprite / onUndo

Method onUndo

src/app/cmd/add_cel.cpp:46–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void AddCel::onUndo()
47{
48 Layer* layer = this->layer();
49 auto cel = this->cel();
50
51 // Save the CelData only if the cel isn't linked
52 bool has_data = (cel->links() == 0);
53 write8(m_stream, has_data ? 1: 0);
54 if (has_data) {
55 write_image(m_stream, cel->image());
56 write_celdata(m_stream, cel->data());
57 }
58 write_cel(m_stream, cel.get());
59 m_size = size_t(m_stream.tellp());
60
61 removeCel(layer, cel);
62}
63
64void AddCel::onRedo()
65{

Callers

nothing calls this directly

Calls 9

write_imageFunction · 0.85
write_celdataFunction · 0.85
write_celFunction · 0.85
linksMethod · 0.80
layerMethod · 0.45
celMethod · 0.45
imageMethod · 0.45
dataMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected