Skip to content

Commit

Permalink
Bugfix: Missing thickness in fallback example settings
Browse files Browse the repository at this point in the history
The fallback example settings (if no example directory was found, e.g. when starting from the source directory) did not create a material thickness, which triggered a warning.

Reproduce:
- Launch visicut via NetBeans IDE (or `ant run`)
- Options -> Download recommended settings  -> Example settings.
- Close and reopen
- Warning: Found material "Acrylic" without a thickness entry - this should not happen! Adding a thickness 0.0 for this material. Please report if you find a way to create materials without a thickness.
  • Loading branch information
mgmax committed Dec 28, 2018
1 parent b1f7707 commit 2f7a260
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/com/t_oster/visicut/managers/PreferencesManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
Expand Down Expand Up @@ -117,12 +119,14 @@ private void generateDefault() throws FileNotFoundException, IOException
mp.setColor(Color.WHITE);
mp.setCutColor(Color.RED);
mp.setEngraveColor(Color.DARK_GRAY);
mp.setMaterialThicknesses(new LinkedList<Float>(Arrays.asList(new Float(1.0))));
MaterialManager.getInstance().add(mp);
mp = new MaterialProfile();
mp.setName("Acrylic");
mp.setColor(Color.BLUE);
mp.setCutColor(Color.RED);
mp.setEngraveColor(Color.WHITE);
mp.setMaterialThicknesses(new LinkedList<Float>(Arrays.asList(new Float(1.0))));
MaterialManager.getInstance().add(mp);
preferences.setLastMaterial(mp.getName());
}
Expand Down

0 comments on commit 2f7a260

Please sign in to comment.