Fixed: #2400 Transforming - buttons must use hittest frame outline

This commit is contained in:
Jindra Petřík
2025-04-19 20:14:59 +02:00
parent f5f1d73b92
commit f843c628b1
3 changed files with 20 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file.
- [#2416] FLA export - shape fixing in some cases
- [#2394] FLA export - shape tweens in some cases
- Not reseting timeline after shape tag type conversion
- [#2400] Transforming - buttons must use hittest frame outline
## [22.0.2] - 2025-01-17
### Added
@@ -3719,6 +3720,7 @@ Major version of SWF to XML export changed to 2.
[#2425]: https://www.free-decompiler.com/flash/issues/2425
[#2416]: https://www.free-decompiler.com/flash/issues/2416
[#2394]: https://www.free-decompiler.com/flash/issues/2394
[#2400]: https://www.free-decompiler.com/flash/issues/2400
[#2375]: https://www.free-decompiler.com/flash/issues/2375
[#2374]: https://www.free-decompiler.com/flash/issues/2374
[#2389]: https://www.free-decompiler.com/flash/issues/2389

View File

@@ -1296,6 +1296,9 @@ public class Timeline {
renderContext.stateUnderCursor.add(layer);
}
} else if (absMat.transform(new ExportRectangle(boundRect)).contains(cursorPositionInView)) {
if ((drawable instanceof ButtonTag) && !renderContext.enableButtons) {
dframe = ButtonTag.FRAME_HITTEST;
}
Shape shape = drawable.getOutline(true, dframe, dtime, layer.ratio, renderContext, absMat, true, viewRect, unzoom);
if (shape.contains(cursorPositionInView)) {
renderContext.stateUnderCursor.add(layer);

View File

@@ -698,6 +698,10 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
if (drawableFrameCount == 0) {
drawableFrameCount = 1;
}
if (dt instanceof ButtonTag) {
dframe = ButtonTag.FRAME_HITTEST;
}
transform = new Matrix(ds.matrix);
@@ -1363,7 +1367,7 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
int drawableFrameCount = dt.getNumFrames();
if (drawableFrameCount == 0) {
drawableFrameCount = 1;
}
}
double zoomDouble = zoom.fit ? getZoomToFit() : zoom.value;
if (lowQuality) {
@@ -1372,7 +1376,6 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
Matrix m = new Matrix();
m.translate(-_viewRect.xMin * zoomDouble, -_viewRect.yMin * zoomDouble);
m.scale(zoomDouble);
int dframe = 0;
Matrix transformation = Matrix.getScaleInstance(1 / SWF.unitDivisor).concatenate(m.concatenate(new Matrix(ds.matrix)));
RECT dtRect = dt.getRect();
Rectangle2D dtRect2D = new Rectangle2D.Double(dtRect.Xmin, dtRect.Ymin, dtRect.getWidth(), dtRect.getHeight());
@@ -3339,6 +3342,11 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
}
int dframe = time % drawableFrameCount;
if (cht instanceof ButtonTag) {
dframe = ButtonTag.FRAME_HITTEST;
}
//Matrix finalMatrix = Matrix.getScaleInstance(1 / SWF.unitDivisor).concatenate(m).concatenate(new Matrix(ds.matrix));
Matrix transform2 = transform;
@@ -4402,6 +4410,11 @@ public final class ImagePanel extends JPanel implements MediaDisplay {
Matrix b = newMatrix; //getParentMatrix().concatenate(newMatrix); //.concatenate(new Matrix(ds.matrix).inverse());
int dframe = time % drawableFrameCount;
if (cht instanceof ButtonTag) {
dframe = ButtonTag.FRAME_HITTEST;
}
double zoomDouble = zoom.fit ? getZoomToFit() : zoom.value;
if (lowQuality) {
zoomDouble /= LQ_FACTOR;