Skip to content

Commit f843c62

Browse files
committed
Fixed: #2400 Transforming - buttons must use hittest frame outline
1 parent f5f1d73 commit f843c62

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file.
2121
- [#2416] FLA export - shape fixing in some cases
2222
- [#2394] FLA export - shape tweens in some cases
2323
- Not reseting timeline after shape tag type conversion
24+
- [#2400] Transforming - buttons must use hittest frame outline
2425

2526
## [22.0.2] - 2025-01-17
2627
### Added
@@ -3719,6 +3720,7 @@ Major version of SWF to XML export changed to 2.
37193720
[#2425]: https://www.free-decompiler.com/flash/issues/2425
37203721
[#2416]: https://www.free-decompiler.com/flash/issues/2416
37213722
[#2394]: https://www.free-decompiler.com/flash/issues/2394
3723+
[#2400]: https://www.free-decompiler.com/flash/issues/2400
37223724
[#2375]: https://www.free-decompiler.com/flash/issues/2375
37233725
[#2374]: https://www.free-decompiler.com/flash/issues/2374
37243726
[#2389]: https://www.free-decompiler.com/flash/issues/2389

libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,9 @@ private void drawDrawable(SWF swf, Matrix strokeTransform, DepthState layer, Mat
12961296
renderContext.stateUnderCursor.add(layer);
12971297
}
12981298
} else if (absMat.transform(new ExportRectangle(boundRect)).contains(cursorPositionInView)) {
1299+
if ((drawable instanceof ButtonTag) && !renderContext.enableButtons) {
1300+
dframe = ButtonTag.FRAME_HITTEST;
1301+
}
12991302
Shape shape = drawable.getOutline(true, dframe, dtime, layer.ratio, renderContext, absMat, true, viewRect, unzoom);
13001303
if (shape.contains(cursorPositionInView)) {
13011304
renderContext.stateUnderCursor.add(layer);

src/com/jpexs/decompiler/flash/gui/ImagePanel.java

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,10 @@ private void calculateFreeOrSelectionTransform() {
698698
if (drawableFrameCount == 0) {
699699
drawableFrameCount = 1;
700700
}
701+
702+
if (dt instanceof ButtonTag) {
703+
dframe = ButtonTag.FRAME_HITTEST;
704+
}
701705
702706
transform = new Matrix(ds.matrix);
703707
@@ -1363,7 +1367,7 @@ public void mouseReleased(MouseEvent e) {
13631367
int drawableFrameCount = dt.getNumFrames();
13641368
if (drawableFrameCount == 0) {
13651369
drawableFrameCount = 1;
1366-
}
1370+
}
13671371

13681372
double zoomDouble = zoom.fit ? getZoomToFit() : zoom.value;
13691373
if (lowQuality) {
@@ -1372,7 +1376,6 @@ public void mouseReleased(MouseEvent e) {
13721376
Matrix m = new Matrix();
13731377
m.translate(-_viewRect.xMin * zoomDouble, -_viewRect.yMin * zoomDouble);
13741378
m.scale(zoomDouble);
1375-
int dframe = 0;
13761379
Matrix transformation = Matrix.getScaleInstance(1 / SWF.unitDivisor).concatenate(m.concatenate(new Matrix(ds.matrix)));
13771380
RECT dtRect = dt.getRect();
13781381
Rectangle2D dtRect2D = new Rectangle2D.Double(dtRect.Xmin, dtRect.Ymin, dtRect.getWidth(), dtRect.getHeight());
@@ -3339,6 +3342,11 @@ private static SerializableImage getFrame(Rectangle realRect, RECT rect, ExportR
33393342
}
33403343

33413344
int dframe = time % drawableFrameCount;
3345+
3346+
if (cht instanceof ButtonTag) {
3347+
dframe = ButtonTag.FRAME_HITTEST;
3348+
}
3349+
33423350
//Matrix finalMatrix = Matrix.getScaleInstance(1 / SWF.unitDivisor).concatenate(m).concatenate(new Matrix(ds.matrix));
33433351

33443352
Matrix transform2 = transform;
@@ -4402,6 +4410,11 @@ private Rectangle2D getTransformBounds() {
44024410

44034411
Matrix b = newMatrix; //getParentMatrix().concatenate(newMatrix); //.concatenate(new Matrix(ds.matrix).inverse());
44044412
int dframe = time % drawableFrameCount;
4413+
4414+
if (cht instanceof ButtonTag) {
4415+
dframe = ButtonTag.FRAME_HITTEST;
4416+
}
4417+
44054418
double zoomDouble = zoom.fit ? getZoomToFit() : zoom.value;
44064419
if (lowQuality) {
44074420
zoomDouble /= LQ_FACTOR;

0 commit comments

Comments
 (0)