diff options
author | bubnikv <bubnikv@gmail.com> | 2018-10-31 18:25:55 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2018-10-31 18:25:55 +0300 |
commit | 7e71aaffd5cf8e9b59662dce736f2556e92fae28 (patch) | |
tree | a6f89eba685e3f9e7aa4f7d5de372b73ffde58aa /src/slic3r/GUI/BedShapeDialog.cpp | |
parent | fd1c5dd2181a03641ae99218b4178fecba2ca95e (diff) | |
parent | afa907504f8f1e044630caf9b008d259601ac9a1 (diff) |
Merge branch 'dev_native' of https://github.com/prusa3d/Slic3r into dev_native
Diffstat (limited to 'src/slic3r/GUI/BedShapeDialog.cpp')
-rw-r--r-- | src/slic3r/GUI/BedShapeDialog.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/slic3r/GUI/BedShapeDialog.cpp b/src/slic3r/GUI/BedShapeDialog.cpp index 656e0847f..66aedf16d 100644 --- a/src/slic3r/GUI/BedShapeDialog.cpp +++ b/src/slic3r/GUI/BedShapeDialog.cpp @@ -28,7 +28,7 @@ void BedShapeDialog::build_dialog(ConfigOptionPoints* default_pt) main_sizer->SetSizeHints(this); // needed to actually free memory - this->Bind(wxEVT_CLOSE_WINDOW, ([this](wxCloseEvent e){ + this->Bind(wxEVT_CLOSE_WINDOW, ([this](wxCloseEvent e) { EndModal(wxID_OK); Destroy(); })); @@ -115,14 +115,15 @@ void BedShapePanel::build_panel(ConfigOptionPoints* default_pt) // Called from the constructor. // Create a panel for a rectangular / circular / custom bed shape. -ConfigOptionsGroupShp BedShapePanel::init_shape_options_page(wxString title){ +ConfigOptionsGroupShp BedShapePanel::init_shape_options_page(wxString title) +{ auto panel = new wxPanel(m_shape_options_book); ConfigOptionsGroupShp optgroup; optgroup = std::make_shared<ConfigOptionsGroup>(panel, _(L("Settings"))); optgroup->label_width = 100; - optgroup->m_on_change = [this](t_config_option_key opt_key, boost::any value){ + optgroup->m_on_change = [this](t_config_option_key opt_key, boost::any value) { update_shape(); }; @@ -234,14 +235,15 @@ void BedShapePanel::update_shape() Vec2d rect_origin(Vec2d::Zero()); try{ rect_size = boost::any_cast<Vec2d>(m_optgroups[SHAPE_RECTANGULAR]->get_value("rect_size")); } - catch (const std::exception & /* e */){ + catch (const std::exception & /* e */) { return; } - try{ + try { rect_origin = boost::any_cast<Vec2d>(m_optgroups[SHAPE_RECTANGULAR]->get_value("rect_origin")); } - catch (const std::exception & /* e */){ - return;} + catch (const std::exception & /* e */) { + return; + } auto x = rect_size(0); auto y = rect_size(1); @@ -269,7 +271,7 @@ void BedShapePanel::update_shape() try{ diameter = boost::any_cast<double>(m_optgroups[SHAPE_CIRCULAR]->get_value("diameter")); } - catch (const std::exception & /* e */){ + catch (const std::exception & /* e */) { return; } if (diameter == 0.0) return ; @@ -277,7 +279,7 @@ void BedShapePanel::update_shape() auto twopi = 2 * PI; auto edges = 60; std::vector<Vec2d> points; - for (size_t i = 1; i <= 60; ++i){ + for (size_t i = 1; i <= 60; ++i) { auto angle = i * twopi / edges; points.push_back(Vec2d(r*cos(angle), r*sin(angle))); } |