also fix serialization

This commit is contained in:
nickgkg
2020-07-16 13:43:49 -04:00
committed by Jindra Petřík
parent 01fee76d81
commit 518a4e21b1

View File

@@ -312,9 +312,9 @@ public class SWFOutputStream extends OutputStream {
* @param value FIXED8 value
* @throws IOException
*/
public void writeFIXED8(float value) throws IOException {
final int divisor = 1 << 8;
int beforePoint = (int) value;
public void writeFIXED8(float value) throws IOException {
int valueInt = (int) (value * (1 << 8));
int beforePoint = (int) valueInt >> 8;
int afterPoint = (int) valueInt % (1 << 8);
writeUI8(afterPoint);
writeSI8(beforePoint);