From a42a6d4d0cc81a03c2e0e36bd48f7bd079ee5390 Mon Sep 17 00:00:00 2001 From: acspike Date: Wed, 19 Apr 2006 13:00:36 +0000 Subject: [PATCH] tweaking for bbyak --- src/selection-chemistry.cpp | 12 ++++++------ src/ui/dialog/document-properties.cpp | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index c87817a40..19f6c4751 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -2554,9 +2554,9 @@ void fit_canvas_to_selection(SPDesktop *desktop) { NRRect bbox = {0,0,0,0}; desktop->selection->bounds(&bbox); - g_return_if_fail(!empty(bbox)); - - doc->fitToRect(bbox); + if (!empty(bbox)) { + doc->fitToRect(bbox); + } }; void fit_canvas_to_drawing(SPDocument *doc) { @@ -2566,9 +2566,9 @@ void fit_canvas_to_drawing(SPDocument *doc) { sp_document_ensure_up_to_date (doc); sp_item_invoke_bbox(SP_ITEM(doc->root), &bbox, sp_item_i2r_affine(SP_ITEM(doc->root)), TRUE); - g_return_if_fail(!empty(bbox)); - - doc->fitToRect(bbox); + if (!empty(bbox)) { + doc->fitToRect(bbox); + } }; void fit_canvas_to_selection_or_drawing(SPDesktop *desktop) { diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 4d7b8abc7..9a9deac9f 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -22,6 +22,7 @@ #include "ui/widget/color-picker.h" #include "ui/widget/scalar-unit.h" +#include "ui/widget/button.h" #include "xml/node-event-vector.h" #include "helper/units.h" @@ -193,7 +194,8 @@ DocumentProperties::build_page() "bordercolor", "borderopacity", _wr); _rcb_shad.init (_("_Show border shadow"), _("If set, page border shows a shadow on its right and lower side"), "inkscape:showpageshadow", _wr, false); _rum_deflt.init (_("Default _units:"), "inkscape:document-units", _wr); - Gtk::Button* fit_canv = manage(new Gtk::Button(_("Fit canvas to current selection"))); + Inkscape::UI::Widget::Button* fit_canv = manage(new Inkscape::UI::Widget::Button(_("Fit canvas to selection"), + _("Fit the canvas to the current selection or fit to the drawing when there is no selection."))); fit_canv->signal_clicked().connect(sigc::ptr_fun(fire_fit_canvas_to_selection_or_drawing)); Gtk::Label* label_gen = manage (new Gtk::Label); label_gen->set_markup (_("General")); -- 2.30.2