mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-26 00:55:33 +00:00
PDF - try to implement objects grouping
This commit is contained in:
@@ -31,7 +31,7 @@ import java.util.Map;
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public class DualPdfGraphics2D extends Graphics2D implements BlendModeSetable {
|
||||
public class DualPdfGraphics2D extends Graphics2D implements BlendModeSetable, GraphicsGroupable {
|
||||
|
||||
private final Graphics2D imageGraphics;
|
||||
|
||||
@@ -513,4 +513,14 @@ public class DualPdfGraphics2D extends Graphics2D implements BlendModeSetable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Graphics createGroup() {
|
||||
return pdfGraphics.createXObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawGroup(Graphics g) {
|
||||
pdfGraphics.drawXObject(g);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.jpexs.decompiler.flash.exporters;
|
||||
|
||||
import java.awt.Graphics;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JPEXS
|
||||
*/
|
||||
public interface GraphicsGroupable {
|
||||
|
||||
public Graphics createGroup();
|
||||
|
||||
public void drawGroup(Graphics g);
|
||||
}
|
||||
@@ -19,6 +19,7 @@ package com.jpexs.decompiler.flash.timeline;
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.exporters.BlendModeSetable;
|
||||
import com.jpexs.decompiler.flash.exporters.FrameExporter;
|
||||
import com.jpexs.decompiler.flash.exporters.GraphicsGroupable;
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.ExportRectangle;
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.Matrix;
|
||||
import com.jpexs.decompiler.flash.exporters.commonshape.SVGExporter;
|
||||
@@ -60,6 +61,7 @@ import com.jpexs.helpers.SerializableImage;
|
||||
import java.awt.AlphaComposite;
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.RenderingHints;
|
||||
@@ -726,8 +728,17 @@ public class Timeline {
|
||||
img = image;
|
||||
m = mat.clone();
|
||||
g.setTransform(new AffineTransform());
|
||||
//g.setClip(null);
|
||||
//m = m.concatenate(drawMatrix);
|
||||
|
||||
/*if (g instanceof GraphicsGroupable) {
|
||||
Graphics subG = ((GraphicsGroupable) g).createGroup();
|
||||
|
||||
img = new SerializableImage(newWidth, newHeight, SerializableImage.TYPE_INT_ARGB_PRE) {
|
||||
@Override
|
||||
public Graphics getGraphics() {
|
||||
return subG;
|
||||
}
|
||||
};
|
||||
}*/
|
||||
}
|
||||
|
||||
ColorTransform clrTrans2 = clrTrans;
|
||||
@@ -854,6 +865,11 @@ public class Timeline {
|
||||
g2.draw(shape);
|
||||
}
|
||||
|
||||
/*if (sameImage && canUseSameImage) {
|
||||
if (g instanceof GraphicsGroupable) {
|
||||
((GraphicsGroupable) g).drawGroup(img.getGraphics());
|
||||
}
|
||||
}*/
|
||||
if (!(sameImage && canUseSameImage)) {
|
||||
g.setTransform(drawMatrix.toTransform());
|
||||
g.drawImage(img.getBufferedImage(), 0, 0, null);
|
||||
|
||||
Reference in New Issue
Block a user