X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fapp.cpp;h=62780a660654b7723e3fe637cdc9778f65da3941;hb=9d5f2f4000fc7a92b3f9dccc395413ed3de684a2;hp=beb061d2efe6242934480610cadc1b017adfc5b2;hpb=6378887f493519667554c9cb3eb7a576440459d6;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/app.cpp b/synfig-studio/trunk/src/gtkmm/app.cpp index beb061d..62780a6 100644 --- a/synfig-studio/trunk/src/gtkmm/app.cpp +++ b/synfig-studio/trunk/src/gtkmm/app.cpp @@ -8,6 +8,7 @@ ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** Copyright (c) 2007, 2008 Chris Moore ** Copyright (c) 2008 Gerald Young +** Copyright (c) 2008 Carlos López ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -1256,9 +1257,7 @@ App::App(int *argc, char ***argv): if(!getenv("SYNFIG_DISABLE_DRAW" )) state_manager->add_state(&state_draw); // Enabled for now. Let's see whether they're good enough yet. if(!getenv("SYNFIG_DISABLE_SKETCH" )) state_manager->add_state(&state_sketch); - - // Disabled by default - it doesn't work properly? - if(getenv("SYNFIG_ENABLE_WIDTH" )) state_manager->add_state(&state_width); + if(!getenv("SYNFIG_DISABLE_WIDTH" )) state_manager->add_state(&state_width); // Enabled since 0.61.09 studio_init_cb.task(_("Init ModPalette...")); module_list_.push_back(new ModPalette()); module_list_.back()->start(); @@ -2340,8 +2339,9 @@ App::open_as(std::string filename,std::string as) try { OneMoment one_moment; + String errors; - etl::handle canvas(open_canvas_as(filename,as)); + etl::handle canvas(open_canvas_as(filename,as,errors)); if(canvas && get_instance(canvas)) { get_instance(canvas)->find_canvas_view(canvas)->present(); @@ -2351,7 +2351,7 @@ App::open_as(std::string filename,std::string as) else { if(!canvas) - throw (String)strprintf(_("Unable to open file \"%s\""),filename.c_str()); + throw (String)strprintf(_("Unable to load \"%s\":\n\n"),filename.c_str()) + errors; if (as.find(custom_filename_prefix.c_str()) != 0) add_recent_file(as); @@ -2398,8 +2398,10 @@ App::new_instance() canvas->rend_desc().set_time_end(5.0); canvas->rend_desc().set_x_res(DPI2DPM(72.0f)); canvas->rend_desc().set_y_res(DPI2DPM(72.0f)); - canvas->rend_desc().set_tl(Vector(-4,2.25)); - canvas->rend_desc().set_br(Vector(4,-2.25)); + // The top left and botton right positions are expressed in units + // Original convention is that 1 unit = 60 pixels + canvas->rend_desc().set_tl(Vector(-(preferred_x_size/60.0)/2.0,(preferred_y_size/60.0)/2.0)); + canvas->rend_desc().set_br(Vector((preferred_x_size/60.0)/2.0,-(preferred_y_size/60.0)/2.0)); canvas->rend_desc().set_w(preferred_x_size); canvas->rend_desc().set_h(preferred_y_size); canvas->rend_desc().set_antialias(1);