diff options
| author | MenTaLguY <mental@rydia.net> | 2007-03-11 19:57:07 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2007-03-11 19:57:07 +0000 |
| commit | 58b0e69b7336a8a06c447cf786f73df903120e53 (patch) | |
| tree | 7b4e064fee2a8813127b3c1f3ee3a68425d8990c /src/dialogs/object-properties.cpp | |
| parent | Add ctrl+click to paint bucket to change clicked object's fill and stroke to ... (diff) | |
| download | inkscape-58b0e69b7336a8a06c447cf786f73df903120e53.tar.gz inkscape-58b0e69b7336a8a06c447cf786f73df903120e53.zip | |
Switch selection bounds and center to use NR::Maybe, addressing most of the
recent bbox regressions.
(bzr r2604)
Diffstat (limited to 'src/dialogs/object-properties.cpp')
| -rw-r--r-- | src/dialogs/object-properties.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/dialogs/object-properties.cpp b/src/dialogs/object-properties.cpp index 53b9aa8cc..4db82385a 100644 --- a/src/dialogs/object-properties.cpp +++ b/src/dialogs/object-properties.cpp @@ -342,13 +342,15 @@ sp_fillstroke_selection_changed ( Inkscape::Application *inkscape, case QUERY_STYLE_SINGLE: case QUERY_STYLE_MULTIPLE_AVERAGED: case QUERY_STYLE_MULTIPLE_SAME: - NR::Rect bbox = sp_desktop_selection(SP_ACTIVE_DESKTOP)->bounds(); - double perimeter = bbox.extent(NR::X) + bbox.extent(NR::Y); - gtk_widget_set_sensitive (b, TRUE); - //update blur widget value - float radius = query->filter_gaussianBlur_deviation.value; - float percent = radius * 400 / perimeter; // so that for a square, 100% == half side - gtk_adjustment_set_value(bluradjustment, percent); + NR::Maybe<NR::Rect> bbox = sp_desktop_selection(SP_ACTIVE_DESKTOP)->bounds(); + if (bbox) { + double perimeter = bbox->extent(NR::X) + bbox->extent(NR::Y); + gtk_widget_set_sensitive (b, TRUE); + //update blur widget value + float radius = query->filter_gaussianBlur_deviation.value; + float percent = radius * 400 / perimeter; // so that for a square, 100% == half side + gtk_adjustment_set_value(bluradjustment, percent); + } break; } @@ -411,13 +413,17 @@ sp_fillstroke_blur_changed (GtkAdjustment *a, SPWidget *base) //get current selection Inkscape::Selection *selection = sp_desktop_selection (desktop); + + NR::Maybe<NR::Rect> bbox = selection->bounds(); + if (!bbox) { + return; + } //get list of selected items GSList const *items = selection->itemList(); //get current document SPDocument *document = sp_desktop_document (desktop); - NR::Rect bbox = selection->bounds(); - double perimeter = bbox.extent(NR::X) + bbox.extent(NR::Y); + double perimeter = bbox->extent(NR::X) + bbox->extent(NR::Y); double radius = a->value * perimeter / 400; //apply created filter to every selected item |
