Auto update bounds on points save.

Select cursor.
This commit is contained in:
Jindra Petřík
2022-12-31 23:58:51 +01:00
parent ba01de17a1
commit d13d3ac500
5 changed files with 20 additions and 5 deletions
@@ -195,10 +195,7 @@ public class SvgImporter {
st.shapes = shapes;
if (!fill) {
st.shapeBounds = shapes.getBounds(st.getShapeNum());
if (st instanceof DefineShape4Tag) {
((DefineShape4Tag)st).edgeBounds = shapes.getEdgeBounds();
}
st.updateBounds();
}
st.setModified(true);
@@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.types.SHAPEWITHSTYLE;
import com.jpexs.decompiler.flash.types.annotations.Reserved;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.decompiler.flash.types.annotations.SWFVersion;
import com.jpexs.decompiler.flash.types.shaperecords.SHAPERECORD;
import com.jpexs.helpers.ByteArrayRange;
import java.io.IOException;
@@ -109,4 +110,12 @@ public class DefineShape4Tag extends ShapeTag {
public int getShapeNum() {
return 4;
}
@Override
public void updateBounds() {
super.updateBounds();
edgeBounds = SHAPERECORD.getBounds(shapes.shapeRecords, null, 4, true);
}
}
@@ -263,4 +263,8 @@ public abstract class ShapeTag extends DrawableTag implements LazyObject {
public void setCharacterId(int characterId) {
this.shapeId = characterId;
}
public void updateBounds() {
shapeBounds = SHAPERECORD.getBounds(shapes.shapeRecords, shapes.lineStyles, getShapeNum(), false);
}
}