diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2018-05-09 13:07:03 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2018-05-09 13:07:03 +0000 |
| commit | 9c6f702ebfbd401e7d4119b6d6b434783cf4c5b4 (patch) | |
| tree | 97ef62fc5823e6d784bc9259f889ad11c0e659f0 /src/object | |
| parent | Create stateless alignment selector and use it instead (diff) | |
| parent | Guides created after "lock all guides" selected should be locked (diff) | |
| download | inkscape-9c6f702ebfbd401e7d4119b6d6b434783cf4c5b4.tar.gz inkscape-9c6f702ebfbd401e7d4119b6d6b434783cf4c5b4.zip | |
Merge branch 'guidespanel' of gitlab.com:darktrojan/inkscape
Diffstat (limited to 'src/object')
| -rw-r--r-- | src/object/sp-guide.cpp | 3 | ||||
| -rw-r--r-- | src/object/sp-namedview.cpp | 7 | ||||
| -rw-r--r-- | src/object/sp-namedview.h | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/src/object/sp-guide.cpp b/src/object/sp-guide.cpp index 25bcee92b..19aced5c0 100644 --- a/src/object/sp-guide.cpp +++ b/src/object/sp-guide.cpp @@ -222,6 +222,9 @@ SPGuide *SPGuide::createSPGuide(SPDocument *doc, Geom::Point const &pt1, Geom::P SPNamedView *namedview = sp_document_namedview(doc, NULL); if (namedview) { + if (namedview->lockguides) { + repr->setAttribute("inkscape:locked", "true"); + } namedview->appendChild(repr); } Inkscape::GC::release(repr); diff --git a/src/object/sp-namedview.cpp b/src/object/sp-namedview.cpp index 59c7129f6..7cea56119 100644 --- a/src/object/sp-namedview.cpp +++ b/src/object/sp-namedview.cpp @@ -590,6 +590,7 @@ void SPNamedView::set(unsigned int key, const gchar* value) { } case SP_ATTR_INKSCAPE_LOCKGUIDES: this->lockguides = value ? sp_str_to_bool(value) : FALSE; + this->lockGuides(); this->requestModified(SP_OBJECT_MODIFIED_FLAG); break; default: @@ -1098,6 +1099,12 @@ bool SPNamedView::getGuides() return v; } + +void SPNamedView::lockGuides() +{ + sp_namedview_lock_guides(this); +} + /** * Gets page fitting margin information from the namedview node in the XML. * \param nv_repr reference to this document's namedview diff --git a/src/object/sp-namedview.h b/src/object/sp-namedview.h index 20d762bc4..8a46d3fd5 100644 --- a/src/object/sp-namedview.h +++ b/src/object/sp-namedview.h @@ -98,6 +98,7 @@ public: void setSnapGlobal(bool v); void setGuides(bool v); bool getGuides(); + void lockGuides(); private: double getMarginLength(gchar const * const key,Inkscape::Util::Unit const * const margin_units,Inkscape::Util::Unit const * const return_units,double const width,double const height,bool const use_width); |
