Fixed #2397 DefineScalingGrid - improper scaling on negative Xmin, Ymin

This commit is contained in:
Jindra Petřík
2025-04-13 09:29:14 +02:00
parent 47204234a0
commit 94874d2b68
2 changed files with 14 additions and 2 deletions

View File

@@ -189,10 +189,20 @@ public class DefineScalingGridTag extends Tag implements CharacterIdTag {
public static void getSlices(ExportRectangle targetBounds, ExportRectangle boundsRect, ExportRectangle scalingGrid, ExportRectangle[] sourceRect, ExportRectangle[] targetRect, Matrix[] transforms) {
double[] src_x = new double[]{boundsRect.xMin, scalingGrid.xMin, scalingGrid.xMax, boundsRect.xMax};
double[] dst_x = new double[]{targetBounds.xMin, targetBounds.xMin + scalingGrid.xMin, targetBounds.xMax - (boundsRect.xMax - scalingGrid.xMax), targetBounds.xMax};
double[] dst_x = new double[]{
targetBounds.xMin,
targetBounds.xMin + scalingGrid.xMin - boundsRect.xMin,
targetBounds.xMax - (boundsRect.xMax - scalingGrid.xMax),
targetBounds.xMax
};
double[] src_y = new double[]{boundsRect.yMin, scalingGrid.yMin, scalingGrid.yMax, boundsRect.yMax};
double[] dst_y = new double[]{targetBounds.yMin, targetBounds.yMin + scalingGrid.yMin, targetBounds.yMax - (boundsRect.yMax - scalingGrid.yMax), targetBounds.yMax};
double[] dst_y = new double[]{
targetBounds.yMin,
targetBounds.yMin + scalingGrid.yMin - boundsRect.yMin,
targetBounds.yMax - (boundsRect.yMax - scalingGrid.yMax),
targetBounds.yMax
};
int pos = 0;
for (int sy = 0; sy < 3; sy++) {