Skip to content

Commit

Permalink
03.06.2024 another bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tstamborski committed Jun 3, 2024
1 parent 33eddc5 commit e5352bb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions MasterofSprites/nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<group>
<file>file:/C:/Users/tstam/Documents/NetBeansProjects/master-of-sprites/MasterofSprites/src/com/tstamborski/masterofsprites/SpritePreview.java</file>
<file>file:/C:/Users/tstam/Documents/NetBeansProjects/master-of-sprites/MasterofSprites/src/com/tstamborski/masterofsprites/MasterofSprites.java</file>
<file>file:/C:/Users/tstam/Documents/NetBeansProjects/master-of-sprites/MasterofSprites/src/com/tstamborski/masterofsprites/docs/manual.html</file>
<file>file:/C:/Users/tstam/Documents/NetBeansProjects/master-of-sprites/MasterofSprites/src/com/tstamborski/masterofsprites/MainWindow.java</file>
<file>file:/C:/Users/tstam/Documents/NetBeansProjects/master-of-sprites/MasterofSprites/src/com/tstamborski/masterofsprites/EditorPanel.java</file>
<file>file:/C:/Users/tstam/Documents/NetBeansProjects/master-of-sprites/MasterofSprites/src/com/tstamborski/masterofsprites/PreviewPanel.java</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public EditorPanel() {
layoutControls();

setProject(null);
setSelection(null);
}

private void createControls() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.Calendar;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.*;
import javax.swing.*;
import javax.swing.filechooser.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ public PreviewPanel() {
add(northPanel, BorderLayout.NORTH);
add(southPanel, BorderLayout.SOUTH);

currentSelection = new ArrayList<>();

timer = new Timer(100, ae->preview.nextFrame());
frameDelaySpinner.addChangeListener(che->timer.setDelay((Integer)frameDelaySpinner.getValue()));
frameCountSpinner.addChangeListener(che->{
Expand Down Expand Up @@ -172,14 +174,17 @@ public void setProject(SpriteProject p) {
this.project = p;

preview.setProject(this.project);
setSelection(null);
preview.reload();
}

public void setSelection(ArrayList<Integer> s) {
requestedSelection = s;

if (!lockButton.isSelected()) {
currentSelection = requestedSelection;
currentSelection.clear();
if (requestedSelection != null)
requestedSelection.forEach(i->currentSelection.add(i));

if (currentSelection == null)
arrangementModel.setSelectionSize(0);
Expand Down

0 comments on commit e5352bb

Please sign in to comment.