set the minimum core amount to 2 (1 on single core cpus)

This commit is contained in:
harlekin
2021-07-07 16:18:45 +00:00
committed by Sheepit Renderfarm
parent 9a5cd74609
commit 6ca2067cbe
5 changed files with 10 additions and 6 deletions

View File

@@ -368,7 +368,7 @@ public class Settings implements Activity {
display = (double) cpu.cores() / step;
}
cpuCores = new JSlider(1, cpu.cores());
cpuCores = new JSlider(CPU.MIN_CORES, cpu.cores());
cpuCores.setMajorTickSpacing((int) (step));
cpuCores.setMinorTickSpacing(1);
cpuCores.setPaintTicks(true);
@@ -379,7 +379,7 @@ public class Settings implements Activity {
}
});
cpuCores.setPaintLabels(true);
cpuCores.setValue(config.getNbCores() != -1 ? config.getNbCores() : cpuCores.getMaximum());
cpuCores.setValue(config.getNbCores() != -1 ? (Math.max(config.getNbCores(), CPU.MIN_CORES)): cpuCores.getMaximum());
JLabel coreLabel = new JLabel("CPU cores:");
coreLabel.setToolTipText(SwingTooltips.CPU_CORES.getText());