diff options
| author | Eric Greveson <eric@greveson.co.uk> | 2013-07-03 22:57:43 +0000 |
|---|---|---|
| committer | Eric Greveson <eric@greveson.co.uk> | 2013-07-03 22:57:43 +0000 |
| commit | a99dd8508525d8519e46b0acd22e550bf3e39d62 (patch) | |
| tree | ca6c9b77a81e16b500ceedd873838e2a0b06d006 /src/ui | |
| parent | Changed dbus interface to treat 'division' like other boolops, with a new (diff) | |
| parent | Shape calculations. do not quantize the coordinates. (Bug 168158) (diff) | |
| download | inkscape-a99dd8508525d8519e46b0acd22e550bf3e39d62.tar.gz inkscape-a99dd8508525d8519e46b0acd22e550bf3e39d62.zip | |
Merge recent changes from inkscape trunk
(bzr r12387.1.6)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/filter-effects-dialog.cpp | 15 | ||||
| -rw-r--r-- | src/ui/dialog/filter-effects-dialog.h | 1 | ||||
| -rw-r--r-- | src/ui/dialog/layers.cpp | 4 | ||||
| -rw-r--r-- | src/ui/dialog/symbols.cpp | 1 | ||||
| -rw-r--r-- | src/ui/dialog/transformation.cpp | 35 | ||||
| -rw-r--r-- | src/ui/tool/multi-path-manipulator.cpp | 8 |
6 files changed, 59 insertions, 5 deletions
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index 4c289d54e..4401d5658 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -1155,7 +1155,13 @@ FilterEffectsDialog::FilterModifier::FilterModifier(FilterEffectsDialog& d) sw->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); _list.get_column(1)->set_resizable(true); - + _list.set_reorderable(true); + + // We can track the drag/drop reordering from the row_delete (occurs after + // row_inserted and may occur many times when adding a new item) + _model->signal_row_deleted().connect( + sigc::mem_fun(*this, &FilterModifier::on_filter_reorder)); + sw->set_shadow_type(Gtk::SHADOW_IN); show_all_children(); _add.signal_clicked().connect(sigc::mem_fun(*this, &FilterModifier::add_filter)); @@ -1301,6 +1307,13 @@ void FilterEffectsDialog::FilterModifier::on_name_edited(const Glib::ustring& pa } } +void FilterEffectsDialog::FilterModifier::on_filter_reorder(const Gtk::TreeModel::Path& path) { + for(Gtk::TreeModel::iterator i = _model->children().begin(); i != _model->children().end(); ++i) { + SPObject* object = (*i)[_columns.filter]; + object->getRepr()->setPosition(0); + } +} + void FilterEffectsDialog::FilterModifier::on_selection_toggled(const Glib::ustring& path) { Gtk::TreeIter iter = _model->get_iter(path); diff --git a/src/ui/dialog/filter-effects-dialog.h b/src/ui/dialog/filter-effects-dialog.h index 658aac790..a2a2a3c6e 100644 --- a/src/ui/dialog/filter-effects-dialog.h +++ b/src/ui/dialog/filter-effects-dialog.h @@ -86,6 +86,7 @@ private: void on_filter_selection_changed(); void on_name_edited(const Glib::ustring&, const Glib::ustring&); + void on_filter_reorder(const Gtk::TreeModel::Path& path); void on_selection_toggled(const Glib::ustring&); void update_filters(); diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp index 32d85574d..c41046123 100644 --- a/src/ui/dialog/layers.cpp +++ b/src/ui/dialog/layers.cpp @@ -405,13 +405,13 @@ void LayersPanel::_addLayer( SPDocument* doc, SPObject* layer, Gtk::TreeModel::R SPObject *child = _desktop->layer_manager->nthChildOf(layer, i); if ( child ) { #if DUMP_LAYERS - g_message(" %3d layer:%p {%s} [%s]", level, child, child->id, child->label() ); + g_message(" %3d layer:%p {%s} [%s]", level, child, child->getId(), child->label() ); #endif // DUMP_LAYERS Gtk::TreeModel::iterator iter = parentRow ? _store->prepend(parentRow->children()) : _store->prepend(); Gtk::TreeModel::Row row = *iter; row[_model->_colObject] = child; - row[_model->_colLabel] = child->label() ? child->label() : child->getId(); + row[_model->_colLabel] = child->defaultLabel(); row[_model->_colVisible] = SP_IS_ITEM(child) ? !SP_ITEM(child)->isHidden() : false; row[_model->_colLocked] = SP_IS_ITEM(child) ? SP_ITEM(child)->isLocked() : false; diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 09bf1a863..26bc52947 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -26,6 +26,7 @@ #include <gtkmm/label.h> #if WITH_GTKMM_3_0 +# include <gtkmm/togglebutton.h> # include <gtkmm/grid.h> #else # include <gtkmm/table.h> diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index 2ae98beda..ce8af3f1f 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -31,6 +31,7 @@ #include "inkscape.h" #include "selection.h" #include "selection-chemistry.h" +#include "message-stack.h" #include "verbs.h" #include "preferences.h" #include "sp-namedview.h" @@ -902,10 +903,21 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) if (!_units_skew.isAbsolute()) { // percentage double skewX = _scalar_skew_horizontal.getValue("%"); double skewY = _scalar_skew_vertical.getValue("%"); + if (fabs(0.01*skewX*0.01*skewY - 1.0) < Geom::EPSILON) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>.")); + return; + } sp_item_skew_rel (item, 0.01*skewX, 0.01*skewY); } else if (_units_skew.isRadial()) { //deg or rad double angleX = _scalar_skew_horizontal.getValue("rad"); double angleY = _scalar_skew_vertical.getValue("rad"); + if ((fabs(angleX - angleY + M_PI/2) < Geom::EPSILON) + || (fabs(angleX - angleY - M_PI/2) < Geom::EPSILON) + || (fabs((angleX - angleY)/3 + M_PI/2) < Geom::EPSILON) + || (fabs((angleX - angleY)/3 - M_PI/2) < Geom::EPSILON)) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>.")); + return; + } double skewX = tan(-angleX); double skewY = tan(angleY); sp_item_skew_rel (item, skewX, skewY); @@ -916,6 +928,10 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) if (bbox) { double width = bbox->dimensions()[Geom::X]; double height = bbox->dimensions()[Geom::Y]; + if (fabs(skewX*skewY - width*height) < Geom::EPSILON) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>.")); + return; + } sp_item_skew_rel (item, skewX/height, skewY/width); } } @@ -931,16 +947,31 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) if (!_units_skew.isAbsolute()) { // percentage double skewX = _scalar_skew_horizontal.getValue("%"); double skewY = _scalar_skew_vertical.getValue("%"); + if (fabs(0.01*skewX*0.01*skewY - 1.0) < Geom::EPSILON) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>.")); + return; + } sp_selection_skew_relative(selection, *center, 0.01*skewX, 0.01*skewY); } else if (_units_skew.isRadial()) { //deg or rad double angleX = _scalar_skew_horizontal.getValue("rad"); double angleY = _scalar_skew_vertical.getValue("rad"); + if ((fabs(angleX - angleY + M_PI/2) < Geom::EPSILON) + || (fabs(angleX - angleY - M_PI/2) < Geom::EPSILON) + || (fabs((angleX - angleY)/3 + M_PI/2) < Geom::EPSILON) + || (fabs((angleX - angleY)/3 - M_PI/2) < Geom::EPSILON)) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>.")); + return; + } double skewX = tan(-angleX); double skewY = tan(angleY); sp_selection_skew_relative(selection, *center, skewX, skewY); } else { // absolute displacement double skewX = _scalar_skew_horizontal.getValue("px"); double skewY = _scalar_skew_vertical.getValue("px"); + if (fabs(skewX*skewY - width*height) < Geom::EPSILON) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>.")); + return; + } sp_selection_skew_relative(selection, *center, skewX/height, skewY/width); } } @@ -961,6 +992,10 @@ void Transformation::applyPageTransform(Inkscape::Selection *selection) double f = _scalar_transform_f.getValue(); Geom::Affine displayed(a, b, c, d, e, f); + if (displayed.isSingular()) { + sp_desktop_message_stack(getDesktop())->flash(Inkscape::WARNING_MESSAGE, _("Transform matrix is singular, <b>not used</b>.")); + return; + } if (_check_replace_matrix.get_active()) { for (GSList const *l = selection->itemList(); l != NULL; l = l->next) { diff --git a/src/ui/tool/multi-path-manipulator.cpp b/src/ui/tool/multi-path-manipulator.cpp index 70bd0e859..5d5ea2adc 100644 --- a/src/ui/tool/multi-path-manipulator.cpp +++ b/src/ui/tool/multi-path-manipulator.cpp @@ -224,10 +224,12 @@ void MultiPathManipulator::shiftSelection(int dir) SubpathList::iterator last_j; NodeList::iterator last_k; bool anything_found = false; + bool anynode_found = false; for (MapType::iterator i = _mmap.begin(); i != _mmap.end(); ++i) { SubpathList &sp = i->second->subpathList(); for (SubpathList::iterator j = sp.begin(); j != sp.end(); ++j) { + anynode_found = true; for (NodeList::iterator k = (*j)->begin(); k != (*j)->end(); ++k) { if (k->selected()) { last_i = i; @@ -249,10 +251,12 @@ void MultiPathManipulator::shiftSelection(int dir) if (!anything_found) { // select first / last node // this should never fail because there must be at least 1 non-empty manipulator - if (dir == 1) { + if (anynode_found) { + if (dir == 1) { _selection.insert((*_mmap.begin()->second->subpathList().begin())->begin().ptr()); - } else { + } else { _selection.insert((--(*--(--_mmap.end())->second->subpathList().end())->end()).ptr()); + } } return; } |
