mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-29 23:35:40 +00:00
Fixed: #1156 Rendering - 9 slice scaling (DefineScalingGrid) clipping
This commit is contained in:
@@ -12,7 +12,8 @@
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library.
|
||||
* License along with this library.
|
||||
*/
|
||||
package com.jpexs.decompiler.flash.tags;
|
||||
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
@@ -200,29 +201,12 @@ public class DefineScalingGridTag extends Tag implements CharacterIdTag {
|
||||
}
|
||||
|
||||
for (int i = 0; i < targetRect.length; i++) {
|
||||
for (int i = 0; i < targetRect.length; i++) {
|
||||
|
||||
/* sourceRect[i].xMax = roundPixels20(sourceRect[i].xMax);
|
||||
sourceRect[i].yMax = roundPixels20(sourceRect[i].yMax);
|
||||
sourceRect[i].xMin = roundPixels20(sourceRect[i].xMin);
|
||||
sourceRect[i].yMin = roundPixels20(sourceRect[i].yMin);
|
||||
*/
|
||||
//System.out.println("source[" + i + "]=" + sourceRect[i]);
|
||||
//System.out.println("target[" + i + "]=" + targetRect[i]);
|
||||
|
||||
/*targetRect[i].xMax = roundPixels20(targetRect[i].xMax);
|
||||
targetRect[i].yMax = roundPixels20(targetRect[i].yMax);
|
||||
targetRect[i].xMin = roundPixels20(targetRect[i].xMin);
|
||||
targetRect[i].yMin = roundPixels20(targetRect[i].yMin);
|
||||
transforms[i] = rectToRectMatrix(sourceRect[i], targetRect[i]);
|
||||
|
||||
targetRect[i].xMax = Math.rint(targetRect[i].xMax / SWF.unitDivisor);
|
||||
targetRect[i].yMax = Math.rint(targetRect[i].yMax / SWF.unitDivisor);
|
||||
targetRect[i].xMin = Math.rint(targetRect[i].xMin / SWF.unitDivisor);
|
||||
targetRect[i].yMin = Math.rint(targetRect[i].yMin / SWF.unitDivisor);
|
||||
targetRect[i].yMin = Math.rint(targetRect[i].yMin / SWF.unitDivisor);
|
||||
|
||||
//targetRect[i].xMax += maxStroke;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -916,15 +916,32 @@ public class Timeline {
|
||||
DefineScalingGridTag.getSlices(targetBoundsRect, boundsRect, new ExportRectangle(scalingRect), sourceRect, targetRect, transforms);
|
||||
Shape c = g.getClip();
|
||||
AffineTransform origTransform = g.getTransform();
|
||||
for (int s = 0; s < 9; s++) {
|
||||
g.setTransform(new AffineTransform());
|
||||
ExportRectangle p1 = transformation.transform(targetRect[s]);
|
||||
g.setClip(c);
|
||||
int s = 0;
|
||||
for (int sy = 0; sy < 3; sy++) {
|
||||
for (int sx = 0; sx < 3; sx++) {
|
||||
g.setTransform(new AffineTransform());
|
||||
ExportRectangle p1 = transformation.transform(targetRect[s]);
|
||||
g.setClip(c);
|
||||
|
||||
Rectangle2D r = new Rectangle2D.Double(p1.xMin, p1.yMin, p1.getWidth(), p1.getHeight());
|
||||
g.setClip(r);
|
||||
drawDrawable(strokeTransformation.preConcatenate(layerMatrix), layer, transforms[s], g, colorTransform, layer.blendMode, clips, transformation, isClip, layer.clipDepth, absMat, time, layer.ratio, renderContext, image, (DrawableTag) character, layer.filters, unzoom, clrTrans);
|
||||
if (sx == 0) {
|
||||
p1.xMin = 0;
|
||||
}
|
||||
if (sy == 0) {
|
||||
p1.yMin = 0;
|
||||
}
|
||||
|
||||
if (sx == 2) {
|
||||
p1.xMax = Integer.MAX_VALUE;
|
||||
}
|
||||
if (sy == 2) {
|
||||
p1.yMax = Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
Rectangle2D r = new Rectangle2D.Double(p1.xMin, p1.yMin, p1.getWidth(), p1.getHeight());
|
||||
g.setClip(r);
|
||||
drawDrawable(strokeTransformation.preConcatenate(layerMatrix), layer, transforms[s], g, colorTransform, layer.blendMode, clips, transformation, isClip, layer.clipDepth, absMat, time, layer.ratio, renderContext, image, (DrawableTag) character, layer.filters, unzoom, clrTrans);
|
||||
s++;
|
||||
}
|
||||
}
|
||||
g.setClip(c);
|
||||
|
||||
@@ -964,7 +981,8 @@ public class Timeline {
|
||||
}
|
||||
}
|
||||
|
||||
g.setTransform(new AffineTransform());
|
||||
g.setTransform(
|
||||
new AffineTransform());
|
||||
g.setClip(prevClip);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user