From 23c4c03eecb45a88c7c014766d0c32eae3eb1fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=C5=99=C3=ADk?= Date: Tue, 30 Mar 2021 22:20:44 +0200 Subject: [PATCH] Button mousehandling on zoom --- .../src/com/jpexs/decompiler/flash/timeline/Timeline.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java index 712bb87b7..4c5192fe3 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/timeline/Timeline.java @@ -732,8 +732,12 @@ public class Timeline { if (drawable instanceof ButtonTag) { dframe = ButtonTag.FRAME_UP; if (renderContext.cursorPosition != null) { + int dx = (int) (viewRect.xMin * unzoom); + int dy = (int) (viewRect.yMin * unzoom); + Point cursorPositionInView = new Point(renderContext.cursorPosition.x - dx, renderContext.cursorPosition.y - dy); + Shape buttonShape = drawable.getOutline(ButtonTag.FRAME_HITTEST, time, ratio, renderContext, absMat, true); - if (buttonShape.contains(renderContext.cursorPosition)) { + if (buttonShape.contains(cursorPositionInView)) { renderContext.mouseOverButton = (ButtonTag) drawable; if (renderContext.mouseButton > 0) { dframe = ButtonTag.FRAME_DOWN;