Skip to content

Commit

Permalink
fix crash, macos zstd
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Feb 14, 2025
2 parents 456236d + bce2b19 commit e9403e4
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
3 changes: 3 additions & 0 deletions src/libslic3r/AppConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ void AppConfig::set_defaults()
if (get("font_size").empty())
set("font_size", "0");

if (get("side_panel_width").empty())
set("side_panel_width", "42");

if (get("gcodeviewer_decimals").empty())
set("gcodeviewer_decimals", "2");

Expand Down
6 changes: 4 additions & 2 deletions src/libslic3r/GCode/SeamPlacer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,11 @@ PolylineWithEnds extract_perimeter_polylines(const Layer *layer, const SeamPosit
}
path.collect_points(polys.back().points);
assert(polys.back().size() > 1);
current_collected = true;
count_paths_collected++;
} else {
current_collected = previous_collected; // don't break the polyline, just skip the points.
}
count_paths_collected++;
current_collected = true;
}
}
//if (path.role() == ExtrusionRole::erThinWall && also_thin_walls) {
Expand Down
6 changes: 3 additions & 3 deletions src/platform/osx/BuildMacOSImage.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ done
# try with homebrew
ZSDT_FILE=$(ls -v /opt/homebrew/opt/zstd/lib/libzstd.1.*.dylib | tail -n 1)
fi
echo "zstd var:'"$ZSDT_FILE"'";
cp $ZSDT_FILE pack/@SLIC3R_APP_KEY@/@[email protected]/Contents/Frameworks/
ls pack/@SLIC3R_APP_KEY@/@[email protected]/Contents/Frameworks/
echo "zstd var:'"$ZSDT_FILE"' need to be renamed libzstd.1.dylib in Contents/Frameworks";
cp $ZSDT_FILE pack/@SLIC3R_APP_KEY@/@[email protected]/Contents/Frameworks/libzstd.1.dylib
ls -al pack/@SLIC3R_APP_KEY@/@[email protected]/Contents/Frameworks/

# } &> $ROOT/Build.log # Capture all command output
echo -e "\n ... done\n"
Expand Down
13 changes: 10 additions & 3 deletions src/slic3r/GUI/Plater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ void Sidebar::priv::hide_rich_tip(wxButton* btn)
// Sidebar / public

Sidebar::Sidebar(Plater *parent)
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(42 * wxGetApp().em_unit(), -1)), p(new priv(parent))
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(std::max(20, get_app_config()->get_int("side_panel_width")) * wxGetApp().em_unit(), -1)), p(new priv(parent))
{
SetFont(wxGetApp().normal_font());
p->scrolled = new wxScrolledWindow(this);
Expand Down Expand Up @@ -1003,11 +1003,18 @@ void Sidebar::init_filament_combo(PlaterPresetComboBox** combo, const int extr_i
auto opt = wxGetApp().preset_bundle->printers.get_edited_preset().config.option<ConfigOptionStrings>("tool_name");
assert(opt);
std::string tool_name = opt? opt->get_at(extr_idx) : nullptr;
if (tool_name.size() > 10) {
tool_name = tool_name.substr(0,7) + std::string("... ");
int size_panel = get_app_config()->get_int("side_panel_width");
size_t max_letters = size_t(std::max(4, size_panel/4));
if (tool_name.size() > max_letters) {
if (max_letters > 6) {
tool_name = tool_name.substr(0, max_letters-3) + std::string("... ");
} else {
tool_name = tool_name.substr(0, max_letters);
}
}
(*combo)->label = new wxStaticText(p->presets_panel, wxID_ANY, tool_name.empty() ? "" : ( tool_name + std::string(": ")));
(*combo)->label->SetFont(wxGetApp().small_font());
(*combo)->label->SetToolTip(tool_name); //doesn't work in msw because static text doesn't get mouse event
combo_and_btn_sizer->Add((*combo)->label, 0, wxALIGN_LEFT | wxEXPAND | wxRIGHT, 4);
}
combo_and_btn_sizer->Add(*combo, 1, wxEXPAND);
Expand Down
8 changes: 7 additions & 1 deletion src/slic3r/GUI/Preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,13 @@ void PreferencesDialog::build()
L("Show layer area on the scroll bar"),
L("Add the layer area (the number just below the layer id) next to a widget of the layer double-scrollbar."),
app_config->get_bool("show_layer_area_doubleslider"));
}

append_int_option(m_tabid_2_optgroups.back().back(), "side_panel_width", L("Side Panel Width"),
L("The width of the right panel, where the objects , presets and slicing information are "
"displayeed. It's in 'display unit'."),
6, app_config->get_int("side_panel_width"));
m_values_need_restart.push_back("side_panel_width");
}

append_int_option(m_tabid_2_optgroups.back().back(), "gcodeviewer_decimals",
L("Decimals for gcode viewer colors"),
Expand Down

0 comments on commit e9403e4

Please sign in to comment.