Skip to content

Commit

Permalink
Fixed adding of BGItem
Browse files Browse the repository at this point in the history
  • Loading branch information
MonsterDruide1 committed Aug 25, 2019
1 parent 919fa45 commit 15e207f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MiBand4Editor/src/elements/BGItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import javax.swing.JPanel;

import helpers.StaticHelpers;
import main.MiBand4Editor;

public class BGItem extends Element{

Expand All @@ -25,8 +26,7 @@ public class BGItem extends Element{
int y;

public BGItem(File selFile, int i, int x, int y) throws IOException {
String temp = new File(".").getAbsolutePath();
String absolutePath = temp.substring(0,temp.length()-1)+"data";
String absolutePath = MiBand4Editor.currentPath.getAbsolutePath();
file = new File(absolutePath+"\\BGItem"+i+".png");
Files.copy(Paths.get(selFile.getAbsolutePath()), Paths.get(file.getAbsolutePath()),StandardCopyOption.REPLACE_EXISTING);

Expand Down
3 changes: 3 additions & 0 deletions MiBand4Editor/src/elements/activity/Calories.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import display.TopalignedLabel;
import elements.Element;
import elements.basic.Number;
import helpers.StaticHelpers;
import helpers.UnequalDimensionsException;
import main.MiBand4Editor;

Expand All @@ -43,10 +44,12 @@ public JPanel getPreview(int w, int h) throws IOException {
TopalignedLabel label2 = new TopalignedLabel(stepsGoal.getImage(0));
TopalignedLabel label3 = new TopalignedLabel(stepsGoal.getImage(0));
TopalignedLabel label4 = new TopalignedLabel(stepsGoal.getImage(0));
TopalignedLabel label5 = new TopalignedLabel(StaticHelpers.getJLabelFromImage(delimiterImageIndex));
panel.add(label1);
panel.add(label2);
panel.add(label3);
panel.add(label4);
panel.add(label5);
panel.setName(this.getClass().toString());
panel.setOpaque(false);

Expand Down

0 comments on commit 15e207f

Please sign in to comment.