mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 03:40:55 +00:00
Fixed #2178 Tag undo
This commit is contained in:
@@ -459,12 +459,12 @@ public abstract class Tag implements NeedsCharacters, Exportable, Serializable {
|
||||
return originalRange != null && isModified();
|
||||
}
|
||||
|
||||
public void undo() throws InterruptedException, IOException {
|
||||
byte[] data = getOriginalData();
|
||||
if (data == null) { //If the tag is newly created in GUI it has no original data
|
||||
public void undo() throws InterruptedException, IOException {
|
||||
if (originalRange == null) { //If the tag is newly created in GUI it has no original data
|
||||
return;
|
||||
}
|
||||
SWFInputStream tagDataStream = new SWFInputStream(swf, data, getDataPos(), data.length);
|
||||
SWFInputStream tagDataStream = new SWFInputStream(swf, originalRange.getArray(), 0, (int) originalRange.getPos() + originalRange.getLength());
|
||||
tagDataStream.seek(getDataPos());
|
||||
readData(tagDataStream, getOriginalRange(), 0, false, true, false);
|
||||
setModified(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user