mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-01 11:53:21 +00:00
Issue #495: font saving ix
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.jpexs.decompiler.flash;
|
||||
|
||||
import com.jpexs.decompiler.flash.types.RECT;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
@@ -139,4 +140,22 @@ public class SWFStreamTest {
|
||||
assertEquals(ff, sis.readFIXED8());
|
||||
sis.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRECT() throws IOException {
|
||||
RECT rect;
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
try (SWFOutputStream sos = new SWFOutputStream(baos, 10)) {
|
||||
rect = new RECT(-0x80000000, 0x7FFFFFFF, -0x80000000, 0x7FFFFFFF);
|
||||
sos.writeRECT(rect);
|
||||
}
|
||||
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
|
||||
try (SWFInputStream sis = new SWFInputStream(bais, 10)) {
|
||||
RECT readRECT = sis.readRECT();
|
||||
assertEquals(readRECT.Xmin, -0x3FFFFFFF);
|
||||
assertEquals(readRECT.Xmax, 0x3FFFFFFF);
|
||||
assertEquals(readRECT.Ymin, -0x3FFFFFFF);
|
||||
assertEquals(readRECT.Ymax, 0x3FFFFFFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user