Fixed: #1675 Viewport/zoom fix

This commit is contained in:
Jindra Petřík
2021-04-05 10:40:17 +02:00
parent 46f8e9a20c
commit 6b78b2fc44
17 changed files with 58 additions and 43 deletions

View File

@@ -1646,10 +1646,10 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
image.fillTransparent();
Matrix m = Matrix.getTranslateInstance(-rect.Xmin * zoomDouble, -rect.Ymin * zoomDouble);
m.scale(zoomDouble);
textTag.toImage(0, 0, 0, new RenderContext(), image, false, m, m, m, m, new ConstantColorColorTransform(0xFFC0C0C0), zoomDouble, false, new ExportRectangle(rect), true, Timeline.DRAW_MODE_ALL);
textTag.toImage(0, 0, 0, new RenderContext(), image, image, false, m, m, m, m, new ConstantColorColorTransform(0xFFC0C0C0), zoomDouble, false, new ExportRectangle(rect), true, Timeline.DRAW_MODE_ALL);
if (newTextTag != null) {
newTextTag.toImage(0, 0, 0, new RenderContext(), image, false, m, m, m, m, new ConstantColorColorTransform(0xFF000000), zoomDouble, false, new ExportRectangle(rect), true, Timeline.DRAW_MODE_ALL);
newTextTag.toImage(0, 0, 0, new RenderContext(), image, image, false, m, m, m, m, new ConstantColorColorTransform(0xFF000000), zoomDouble, false, new ExportRectangle(rect), true, Timeline.DRAW_MODE_ALL);
}
iconPanel.setImg(image);
@@ -1784,7 +1784,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
m.scale(zoom);
Matrix fullM = m.clone();
//fullM.translate(viewRect.xMin * zoom, viewRect.yMin * zoom);
MATRIX oldMatrix = null;
if (freeTransformDepth > -1) {
@@ -1796,7 +1796,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
timeline.getFrame(frame).layers.get(freeTransformDepth).matrix = newMatrix;
}
timeline.toImage(frame, time, renderContext, image, false, m, new Matrix(), m, null, zoom, false, viewRect, fullM, true, Timeline.DRAW_MODE_ALL);
timeline.toImage(frame, time, renderContext, image, image, false, m, new Matrix(), m, null, zoom, false, viewRect, fullM, true, Timeline.DRAW_MODE_ALL);
Graphics2D gg = (Graphics2D) image.getGraphics();
gg.setStroke(new BasicStroke(3));