From: Carlos Lopez Date: Sat, 15 May 2010 10:46:13 +0000 (+0200) Subject: Fix bug of conversion of float to int at the wrong moment. Add some debug info. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7b3e1122fb62bcac92f5db9afe41a00d750febde;p=synfig.git Fix bug of conversion of float to int at the wrong moment. Add some debug info. --- diff --git a/synfig-studio/src/gtkmm/app.cpp b/synfig-studio/src/gtkmm/app.cpp index dc85ffd..c582590 100644 --- a/synfig-studio/src/gtkmm/app.cpp +++ b/synfig-studio/src/gtkmm/app.cpp @@ -1773,12 +1773,12 @@ App::reset_initial_window_configuration() // was introduced in gtkmm 2.20 I assume that the monitor 0 is the // primary one. screen->get_monitor_geometry(0,rect); -#define hpanel_width 79 -#define hpanel_height 25 -#define vpanel_width 20 -#define vpanel_height 100 -#define vdock 20 -#define hdock 20 +#define hpanel_width 79.0f +#define hpanel_height 25.0f +#define vpanel_width 20.0f +#define vpanel_height 100.0f +#define vdock 20.0f +#define hdock 20.0f /* percentages referred to width or height of the screen *---------------------------------------------------------------------* @@ -1804,38 +1804,50 @@ App::reset_initial_window_configuration() * --------------------------------------------------------------------* */ // Vertical Panel - int v_xpos=rect.get_x() + rect.get_width()*(1-vpanel_width/100); - int v_xsize=rect.get_width()*vpanel_width/100; + int v_xpos=rect.get_x() + rect.get_width()*(1.0-vpanel_width/100.0); + int v_xsize=rect.get_width()*vpanel_width/100.0; int v_ypos=rect.get_y(); - int v_ysize=rect.get_height()*vpanel_height/100; + int v_ysize=rect.get_height()*vpanel_height/100.0; std::string v_pos(strprintf("%d %d", v_xpos, v_ypos)); std::string v_size(strprintf("%d %d", v_xsize, v_ysize)); // Horizontal Panel int h_xpos=rect.get_x(); - int h_xsize=rect.get_width()*hpanel_width/100; - int h_ypos=rect.get_y()+ rect.get_height()*(1-hpanel_height/100);; - int h_ysize=rect.get_height()*hpanel_height/100; + int h_xsize=rect.get_width()*hpanel_width/100.0; + int h_ypos=rect.get_y()+ rect.get_height()*(1.0-hpanel_height/100.0);; + int h_ysize=rect.get_height()*hpanel_height/100.0; std::string h_pos(strprintf("%d %d", h_xpos, h_ypos)); std::string h_size(strprintf("%d %d", h_xsize, h_ysize)); - int v_dock = rect.get_height()*vdock/100; - int h_dock = rect.get_width()*hdock/100; + int v_dock1 = rect.get_height()*vdock*0.8/100.0; + int v_dock2 = rect.get_height()*vdock/100.0; + int v_dock3 = rect.get_height()*vdock/100.0; + int h_dock = rect.get_width()*hdock/100.0; //Contents size - std::string v_contents(strprintf("%d %d %d", v_dock, v_dock, v_dock)); + std::string v_contents(strprintf("%d %d %d", v_dock1, v_dock2, v_dock3)); std::string h_contents(strprintf("%d", h_dock)); // Tool Box position std::string tbox_pos(strprintf("%d %d", rect.get_x(), rect.get_y())); + synfig::info("tool box pos: %s", tbox_pos.c_str()); + synfig::info("v_contents sizes: %s", v_contents.c_str()); + synfig::info("v_pos: %s", v_pos.c_str()); + synfig::info("v_sizes: %s", v_size.c_str()); + synfig::info("h_contents sizes: %s", h_contents.c_str()); + synfig::info("h_pos: %s", h_pos.c_str()); + synfig::info("h_sizes: %s", h_size.c_str()); + synfigapp::Main::settings().set_value("dock.dialog.1.comp_selector","1"); synfigapp::Main::settings().set_value("dock.dialog.1.contents","navigator - info pal_edit pal_browse - tool_options history canvases - layers groups"); synfigapp::Main::settings().set_value("dock.dialog.1.contents_size",v_contents); - synfigapp::Main::settings().set_value("dock.dialog.1.pos",v_pos); synfigapp::Main::settings().set_value("dock.dialog.1.size",v_size); + synfigapp::Main::settings().set_value("dock.dialog.1.pos",v_pos); synfigapp::Main::settings().set_value("dock.dialog.2.comp_selector","0"); synfigapp::Main::settings().set_value("dock.dialog.2.contents","params children keyframes | timetrack curves meta_data"); synfigapp::Main::settings().set_value("dock.dialog.2.contents_size",h_contents); - synfigapp::Main::settings().set_value("dock.dialog.2.pos",h_pos); synfigapp::Main::settings().set_value("dock.dialog.2.size",h_size); + synfigapp::Main::settings().set_value("dock.dialog.2.pos",h_pos); synfigapp::Main::settings().set_value("window.toolbox.pos",tbox_pos); + + dock_manager->show_all_dock_dialogs(); } void