mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-22 12:46:30 +00:00
Drawing actions fix.
Frame index fix.
This commit is contained in:
@@ -56,7 +56,7 @@ public class LibraryTreeTable extends JTreeTable {
|
||||
getTree().setShowsRootHandles(true);
|
||||
addKeyListener(new KeyAdapter() {
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
public void keyPressed(KeyEvent e) {
|
||||
int selectedRow = getSelectedRow();
|
||||
JTree tree = getTree();
|
||||
|
||||
@@ -67,7 +67,7 @@ public class LibraryTreeTable extends JTreeTable {
|
||||
|
||||
int parentRow = tree.getRowForPath(path);
|
||||
changeSelection(parentRow, 0, false, false);
|
||||
} else {
|
||||
} else if (path != null) {
|
||||
TreePath parentPath = path.getParentPath();
|
||||
if (parentPath != null) {
|
||||
int parentRow = tree.getRowForPath(parentPath);
|
||||
|
||||
@@ -136,7 +136,7 @@ public class MainFrame extends JFrame {
|
||||
public void frameSelected(int frame, int depth) {
|
||||
stagePanel.selectDepth(depth);
|
||||
stagePanel.pause();
|
||||
stagePanel.gotoFrame(frame);
|
||||
stagePanel.gotoFrame(frame + 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -179,12 +179,23 @@ public class TimelineBodyPanel extends JPanel implements MouseListener, KeyListe
|
||||
g.fillRect(cursor.x * frameWidth + 1, cursor.y * frameHeight + 1, frameWidth - 1, frameHeight - 1);
|
||||
}
|
||||
|
||||
g.setColor(A_COLOR);
|
||||
g.setFont(getFont().deriveFont(FONT_SIZE));
|
||||
int awidth = g.getFontMetrics().stringWidth("a");
|
||||
for (int f = start_f; f <= end_f; f++) {
|
||||
boolean firstAction = true;
|
||||
for (int f = start_f; f <= end_f || (firstAction && f <= max_f); f++) {
|
||||
if (!timeline.getFrame(f).actions.isEmpty()) {
|
||||
g.drawString("a", f * frameWidth + frameWidth / 2 - awidth / 2, frameHeight / 2 + FONT_SIZE / 2);
|
||||
if (firstAction) {
|
||||
drawBlock(g, getEmptyFrameColor(), 0, 0, f, BlockType.EMPTY);
|
||||
}
|
||||
|
||||
int f2 = f + 1;
|
||||
while(f2 <= max_f && timeline.getFrame(f2).actions.isEmpty()) {
|
||||
f2++;
|
||||
}
|
||||
drawBlock(g, getEmptyFrameColor(), 0, f, f2 - f, BlockType.EMPTY);
|
||||
g.setColor(A_COLOR);
|
||||
g.setFont(getFont().deriveFont(FONT_SIZE));
|
||||
g.drawString("a", f * frameWidth + frameWidth / 2 - awidth / 2, frameHeight / 2);
|
||||
firstAction = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,6 +351,7 @@ public class TimelineBodyPanel extends JPanel implements MouseListener, KeyListe
|
||||
}
|
||||
repaint();
|
||||
this.frame = frame;
|
||||
scrollRectToVisible(getFrameBounds(frame, depth));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -355,6 +367,7 @@ public class TimelineBodyPanel extends JPanel implements MouseListener, KeyListe
|
||||
p.y = maxDepth;
|
||||
}
|
||||
frameSelect(p.x, p.y);
|
||||
requestFocusInWindow();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,7 +22,6 @@ import com.jpexs.decompiler.flash.timeline.Timelined;
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.SystemColor;
|
||||
import java.awt.event.AdjustmentEvent;
|
||||
import java.awt.event.AdjustmentListener;
|
||||
@@ -68,7 +67,6 @@ public class TimelinePanel extends JPanel {
|
||||
|
||||
public void setDepth(int depth) {
|
||||
timelineBodyPanel.depthSelect(depth);
|
||||
timelineBodyPanel.scrollRectToVisible(timelineBodyPanel.getDepthBounds(depth));
|
||||
}
|
||||
|
||||
public void setTimelined(Timelined timelined) {
|
||||
|
||||
Reference in New Issue
Block a user