mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-25 22:20:46 +00:00
Shape transform/points edit protection against large rects
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.types;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWFOutputStream;
|
||||
import com.jpexs.decompiler.flash.types.annotations.Calculated;
|
||||
import com.jpexs.decompiler.flash.types.annotations.SWFType;
|
||||
import java.awt.Point;
|
||||
@@ -93,4 +94,13 @@ public class RECT implements Serializable {
|
||||
public Point getBottomRight() {
|
||||
return new Point(Xmax, Ymax);
|
||||
}
|
||||
|
||||
public void calculateBits() {
|
||||
nbits = SWFOutputStream.getNeededBitsS(Xmin, Xmax, Ymin, Ymax);
|
||||
}
|
||||
|
||||
public boolean isTooLarge() {
|
||||
calculateBits();
|
||||
return !SWFOutputStream.fitsInUB(5, nbits);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user