diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-12-04 20:22:15 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-12-04 20:22:15 +0000 |
| commit | 0c9f0d1d84f706590c8704b32d06270ec0eacbea (patch) | |
| tree | 9ea8f5c06da1c8787f7ebe882248a77f9d3ce1fa /src/ui | |
| parent | Remobing bspline interpolator (diff) | |
| parent | CairoRenderer: print warning if rendering failed (diff) | |
| download | inkscape-0c9f0d1d84f706590c8704b32d06270ec0eacbea.tar.gz inkscape-0c9f0d1d84f706590c8704b32d06270ec0eacbea.zip | |
Update to trunk
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/clipboard.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/xml-tree.cpp | 2 | ||||
| -rw-r--r-- | src/ui/tools/measure-tool.cpp | 20 | ||||
| -rw-r--r-- | src/ui/tools/pencil-tool.cpp | 4 |
4 files changed, 23 insertions, 5 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index 118d7ae1f..a0f1fa09c 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -672,7 +672,7 @@ std::vector<Glib::ustring> ClipboardManagerImpl::getElementsOfType(SPDesktop *de root->removeChild(tempdoc->getDefs()->getRepr()); std::vector<Inkscape::XML::Node const *> reprs; if (strcmp(type, "*") == 0){ - //TODO:Fill vector with all posible elements + //TODO:Fill vector with all possible elements std::vector<Glib::ustring> types; types.push_back((Glib::ustring)"svg:path"); types.push_back((Glib::ustring)"svg:circle"); diff --git a/src/ui/dialog/xml-tree.cpp b/src/ui/dialog/xml-tree.cpp index 5747c7726..6429e655d 100644 --- a/src/ui/dialog/xml-tree.cpp +++ b/src/ui/dialog/xml-tree.cpp @@ -447,7 +447,7 @@ void XmlTree::set_tree_select(Inkscape::XML::Node *repr) gtk_tree_selection_select_iter(selection, &node); } else { - g_message("XmlTree::set_tree_select : Couldnt find repr node"); + g_message("XmlTree::set_tree_select : Couldn't find repr node"); } } else { GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); diff --git a/src/ui/tools/measure-tool.cpp b/src/ui/tools/measure-tool.cpp index bd2964d94..8037a02a9 100644 --- a/src/ui/tools/measure-tool.cpp +++ b/src/ui/tools/measure-tool.cpp @@ -602,6 +602,12 @@ bool MeasureTool::root_handler(GdkEvent* event) showInfoBox(motion_w, false); } } else { + SPDesktop *desktop = SP_ACTIVE_DESKTOP; + Inkscape::Util::Unit const * unit = desktop->getNamedView()->getDisplayUnit(); + for (size_t idx = 0; idx < measure_item.size(); ++idx) { + sp_canvas_item_destroy(measure_item[idx]); + } + measure_item.clear(); ret = TRUE; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100); @@ -1153,6 +1159,7 @@ void MeasureTool::showInfoBox(Geom::Point cursor, bool into_groups) double scale = prefs->getDouble("/tools/measure/scale", 100.0) / 100.0; int precision = prefs->getInt("/tools/measure/precision", 2); Glib::ustring unit_name = prefs->getString("/tools/measure/unit"); + bool only_selected = prefs->getBool("/tools/measure/only_selected", false); if (!unit_name.compare("")) { unit_name = "px"; } @@ -1185,6 +1192,14 @@ void MeasureTool::showInfoBox(Geom::Point cursor, bool into_groups) Geom::Point rel_position = Geom::Point(origin, origin); Geom::Point pos = desktop->w2d(cursor); double gap = Inkscape::Util::Quantity::convert(7 + fontsize, "px", unit->abbr); + if (only_selected) { + if (desktop->getSelection()->includes(over)) { + showItemInfoText(pos + (rel_position * zoom),_("Selected"),fontsize); + } else { + showItemInfoText(pos + (rel_position * zoom),_("Not selected"),fontsize); + } + rel_position = Geom::Point(rel_position[Geom::X], rel_position[Geom::Y] + gap); + } if (SP_IS_SHAPE(over)) { precision_str << _("Length") << ": %." << precision << "f %s"; measure_str = g_strdup_printf(precision_str.str().c_str(), item_length, unit_name.c_str()); @@ -1196,7 +1211,6 @@ void MeasureTool::showInfoBox(Geom::Point cursor, bool into_groups) showItemInfoText(pos + (rel_position * zoom),measure_str,fontsize); rel_position = Geom::Point(rel_position[Geom::X], rel_position[Geom::Y] + gap); } - precision_str << "Y: %." << precision << "f %s"; measure_str = g_strdup_printf(precision_str.str().c_str(), item_y, unit_name.c_str()); precision_str.str(""); @@ -1268,8 +1282,12 @@ void MeasureTool::showCanvasItems(bool to_guides, bool to_item, bool to_phantom, current_layer = desktop->currentLayer(); } std::vector<double> intersection_times; + bool only_selected = prefs->getBool("/tools/measure/only_selected", false); for (std::vector<SPItem*>::const_iterator i=items.begin(); i!=items.end(); ++i) { SPItem *item = *i; + if (!desktop->getSelection()->includes(*i) && only_selected) { + continue; + } if(all_layers || (layer_model && layer_model->layerForObject(item) == current_layer)){ if (SP_IS_SHAPE(item)) { calculate_intersections(desktop, item, lineseg, SP_SHAPE(item)->getCurve(), intersection_times); diff --git a/src/ui/tools/pencil-tool.cpp b/src/ui/tools/pencil-tool.cpp index 108a89af8..13d69b063 100644 --- a/src/ui/tools/pencil-tool.cpp +++ b/src/ui/tools/pencil-tool.cpp @@ -113,7 +113,7 @@ void PencilTool::_endpointSnap(Geom::Point &p, guint const state) { } } else { if (!(state & GDK_SHIFT_MASK)) { //SHIFT disables all snapping, except the angular snapping above - //After all, the user explicitely asked for angular snapping by + //After all, the user explicitly asked for angular snapping by //pressing CTRL boost::optional<Geom::Point> origin = this->npoints > 0 ? this->p[0] : boost::optional<Geom::Point>(); spdc_endpoint_snap_free(this, p, origin, state); @@ -325,7 +325,7 @@ bool PencilTool::_handleMotionNotify(GdkEventMotion const &mevent) { // Only in freehand mode we have to add the first point also to this->ps (apparently) // - We cannot add this point in spdc_set_startpoint, because we only need it for freehand // - We cannot do this in the button press handler because at that point we don't know yet - // wheter we're going into freehand mode or not + // whether we're going into freehand mode or not this->ps.push_back(this->p[0]); this->wps.push_back(this->pressure); } |
