Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2019-08-25 11:31:18 +0300
committerYuSanka <yusanka@gmail.com>2019-08-25 11:31:18 +0300
commited2bad6709be341fd2732ffae37b46a15100af51 (patch)
tree2f963bd7ae074dc6466b0d69aa24981ba8c11285 /src/slic3r/GUI/PresetBundle.cpp
parent55b2b0737c33214f874b0c06927f48cfc1fb6315 (diff)
Unified calculation of icon size for preset BitmapComboBox
Diffstat (limited to 'src/slic3r/GUI/PresetBundle.cpp')
-rw-r--r--src/slic3r/GUI/PresetBundle.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/slic3r/GUI/PresetBundle.cpp b/src/slic3r/GUI/PresetBundle.cpp
index 3aee71c4c..d6e99b014 100644
--- a/src/slic3r/GUI/PresetBundle.cpp
+++ b/src/slic3r/GUI/PresetBundle.cpp
@@ -1487,11 +1487,16 @@ void PresetBundle::update_platter_filament_ui(unsigned int idx_extruder, GUI::Pr
* and scale them in respect to em_unit value
*/
const float scale_f = ui->em_unit() * 0.1f;
- const int icon_height = 16 * scale_f + 0.5f;
- const int normal_icon_width = 16 * scale_f + 0.5f;
+
+ // To avoid the errors of number rounding for different combination of monitor configuration,
+ // let use scaled 8px, as a smallest icon unit
+ const int icon_unit = 8 * scale_f + 0.5f;
+ const int icon_height = 2 * icon_unit; //16 * scale_f + 0.5f;
+ const int normal_icon_width = 2 * icon_unit; //16 * scale_f + 0.5f;
+ const int thin_icon_width = icon_unit; //8 * scale_f + 0.5f;
+ const int wide_icon_width = 3 * icon_unit; //24 * scale_f + 0.5f;
+
const int space_icon_width = 2 * scale_f + 0.5f;
- const int wide_icon_width = 24 * scale_f + 0.5f;
- const int thin_icon_width = 8 * scale_f + 0.5f;
for (int i = this->filaments().front().is_visible ? 0 : 1; i < int(this->filaments().size()); ++i) {
const Preset &preset = this->filaments.preset(i);