Skip to content

Commit

Permalink
Fix color selector issues, bump version to v1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Kakifrucht committed Sep 22, 2017
1 parent 1ed3cac commit 498591f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.lightbeat</groupId>
<artifactId>LightBeat</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>

<build>
<finalName>${project.artifactId}</finalName>
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/io/lightbeat/gui/frame/ColorSelectionFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,13 @@ private void addColorTile(Color color) {
@Override
public void mousePressed(MouseEvent e) {
selectedColorsPanel.remove(tile);
selectedColorsPanel.updateUI();

selectedColorsPanel.revalidate();
updateSaveButton(-1);
}
});

selectedColorsPanel.add(tile);
selectedColorsPanel.updateUI();
selectedColorsPanel.revalidate();
updateSaveButton(-1);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/lightbeat/gui/frame/MainFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ void refreshColorSets() {
}

colorsPreviewPanel.setColorSet(getHueManager().getColorSet());
colorSelectPanel.updateUI();
colorSelectPanel.repaint();
frame.pack();
}

Expand Down
11 changes: 6 additions & 5 deletions src/main/java/io/lightbeat/gui/swing/JColorPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ public class JColorPanel extends JPanel {
public JColorPanel() {
super();
setBorder(new LineBorder(java.awt.Color.BLACK));
createCanvas();
repaintCanvas();
addComponentListener(new ComponentAdapter() {
@Override
public void componentResized(ComponentEvent e) {
createCanvas();
repaintCanvas();
}
});
}
Expand All @@ -45,11 +45,10 @@ public void paintComponent(Graphics graphics) {
public void setColorSet(ColorSet colorSet) {
this.colorSet = colorSet.getColors();
drawSaturationGradient = false;
createCanvas();
updateUI();
repaintCanvas();
}

private void createCanvas() {
private void repaintCanvas() {

int width = getWidth();
int height = getHeight();
Expand Down Expand Up @@ -79,5 +78,7 @@ private void createCanvas() {
}
}
}

repaint();
}
}

0 comments on commit 498591f

Please sign in to comment.