Merge branch 'master' of https://github.com/prusa3d/Slic3r into et_canvas_gui_refactoring
This commit is contained in:
commit
702186eec3
5 changed files with 27 additions and 25 deletions
|
@ -2897,6 +2897,8 @@ NSVGimage* nsvgParse(char* input, const char* units, float dpi)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <boost/nowide/cstdio.hpp>
|
||||||
|
|
||||||
NSVGimage* nsvgParseFromFile(const char* filename, const char* units, float dpi)
|
NSVGimage* nsvgParseFromFile(const char* filename, const char* units, float dpi)
|
||||||
{
|
{
|
||||||
FILE* fp = NULL;
|
FILE* fp = NULL;
|
||||||
|
@ -2904,8 +2906,8 @@ NSVGimage* nsvgParseFromFile(const char* filename, const char* units, float dpi)
|
||||||
char* data = NULL;
|
char* data = NULL;
|
||||||
NSVGimage* image = NULL;
|
NSVGimage* image = NULL;
|
||||||
|
|
||||||
fp = fopen(filename, "rb");
|
fp = boost::nowide::fopen(filename, "rb");
|
||||||
if (!fp) goto error;
|
if (!fp) goto error;
|
||||||
fseek(fp, 0, SEEK_END);
|
fseek(fp, 0, SEEK_END);
|
||||||
size = ftell(fp);
|
size = ftell(fp);
|
||||||
fseek(fp, 0, SEEK_SET);
|
fseek(fp, 0, SEEK_SET);
|
||||||
|
|
|
@ -584,6 +584,11 @@ void Choice::BUILD() {
|
||||||
|
|
||||||
void Choice::set_selection()
|
void Choice::set_selection()
|
||||||
{
|
{
|
||||||
|
/* To prevent earlier control updating under OSX set m_disable_change_event to true
|
||||||
|
* (under OSX wxBitmapComboBox send wxEVT_COMBOBOX even after SetSelection())
|
||||||
|
*/
|
||||||
|
m_disable_change_event = true;
|
||||||
|
|
||||||
wxString text_value = wxString("");
|
wxString text_value = wxString("");
|
||||||
|
|
||||||
wxBitmapComboBox* field = dynamic_cast<wxBitmapComboBox*>(window);
|
wxBitmapComboBox* field = dynamic_cast<wxBitmapComboBox*>(window);
|
||||||
|
|
|
@ -110,7 +110,7 @@ bool GLTexture::load_from_svg_files_as_sprites_array(const std::vector<std::stri
|
||||||
if (!boost::algorithm::iends_with(filename, ".svg"))
|
if (!boost::algorithm::iends_with(filename, ".svg"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
NSVGimage* image = nsvgParseFromFile(encode_path(filename.c_str()).c_str(), "px", 96.0f);
|
NSVGimage* image = nsvgParseFromFile(filename.c_str(), "px", 96.0f);
|
||||||
if (image == nullptr)
|
if (image == nullptr)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -363,7 +363,7 @@ bool GLTexture::load_from_png(const std::string& filename, bool use_mipmaps)
|
||||||
|
|
||||||
bool GLTexture::load_from_svg(const std::string& filename, bool use_mipmaps, unsigned int max_size_px)
|
bool GLTexture::load_from_svg(const std::string& filename, bool use_mipmaps, unsigned int max_size_px)
|
||||||
{
|
{
|
||||||
NSVGimage* image = nsvgParseFromFile(encode_path(filename.c_str()).c_str(), "px", 96.0f);
|
NSVGimage* image = nsvgParseFromFile(filename.c_str(), "px", 96.0f);
|
||||||
if (image == nullptr)
|
if (image == nullptr)
|
||||||
{
|
{
|
||||||
// printf("Could not open SVG image.\n");
|
// printf("Could not open SVG image.\n");
|
||||||
|
|
|
@ -427,7 +427,7 @@ FreqChangedParams::FreqChangedParams(wxWindow* parent, const int label_width) :
|
||||||
|
|
||||||
option = m_og->get_option("fill_density");
|
option = m_og->get_option("fill_density");
|
||||||
option.opt.label = L("Infill");
|
option.opt.label = L("Infill");
|
||||||
option.opt.width = 7 * wxGetApp().em_unit();
|
option.opt.width = 5 * wxGetApp().em_unit();
|
||||||
option.opt.sidetext = " ";
|
option.opt.sidetext = " ";
|
||||||
line.append_option(option);
|
line.append_option(option);
|
||||||
|
|
||||||
|
|
|
@ -927,31 +927,26 @@ void Tab::update_frequently_changed_parameters()
|
||||||
auto og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params(supports_printer_technology(ptFFF));
|
auto og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params(supports_printer_technology(ptFFF));
|
||||||
if (!og_freq_chng_params) return;
|
if (!og_freq_chng_params) return;
|
||||||
|
|
||||||
if (m_type == Preset::TYPE_SLA_PRINT)
|
const bool is_fff = supports_printer_technology(ptFFF);
|
||||||
{
|
|
||||||
for (auto opt_key : { "supports_enable", "pad_enable" })
|
|
||||||
{
|
|
||||||
boost::any val = og_freq_chng_params->get_config_value(*m_config, opt_key);
|
|
||||||
og_freq_chng_params->set_value(opt_key, val);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// for m_type == Preset::TYPE_PRINT
|
const std::string support = is_fff ? "support_material" : "supports_enable";
|
||||||
boost::any value = og_freq_chng_params->get_config_value(*m_config, "fill_density");
|
const std::string buildplate_only = is_fff ? "support_material_buildplate_only" : "support_buildplate_only";
|
||||||
og_freq_chng_params->set_value("fill_density", value);
|
|
||||||
|
|
||||||
wxString new_selection = !m_config->opt_bool("support_material") ?
|
wxString new_selection = !m_config->opt_bool(support) ? _("None") :
|
||||||
_("None") :
|
m_config->opt_bool(buildplate_only) ? _("Support on build plate only") :
|
||||||
m_config->opt_bool("support_material_buildplate_only") ?
|
_("Everywhere");
|
||||||
_("Support on build plate only") :
|
|
||||||
_("Everywhere");
|
|
||||||
og_freq_chng_params->set_value("support", new_selection);
|
og_freq_chng_params->set_value("support", new_selection);
|
||||||
|
|
||||||
bool val = m_config->opt_float("brim_width") > 0.0 ? true : false;
|
const std::string updated_value_key = is_fff ? "fill_density" : "pad_enable";
|
||||||
og_freq_chng_params->set_value("brim", val);
|
|
||||||
|
|
||||||
update_wiping_button_visibility();
|
const boost::any val = og_freq_chng_params->get_config_value(*m_config, updated_value_key);
|
||||||
|
og_freq_chng_params->set_value(updated_value_key, val);
|
||||||
|
|
||||||
|
if (is_fff)
|
||||||
|
{
|
||||||
|
og_freq_chng_params->set_value("brim", bool(m_config->opt_float("brim_width") > 0.0));
|
||||||
|
update_wiping_button_visibility();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabPrint::build()
|
void TabPrint::build()
|
||||||
|
|
Loading…
Reference in a new issue