From 2de761f0c46b4f3164d0dc008320da3ad0f35316 Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Fri, 18 Mar 2011 21:29:06 +0100 Subject: D-Bus. Merging branch lp:~joakim-verona/inkscape/dbus-fixes (Bug #666986, Bug #707054 and Bug #707364). (bzr r10114) --- src/document.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index 2a9ad9144..67ce3e26a 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -848,7 +848,11 @@ SPObject *SPDocument::getObjectById(gchar const *id) const g_return_val_if_fail(id != NULL, NULL); GQuark idq = g_quark_from_string(id); - return (SPObject*)g_hash_table_lookup(priv->iddef, GINT_TO_POINTER(idq)); + gpointer rv = g_hash_table_lookup(priv->iddef, GINT_TO_POINTER(idq)); + if(rv != NULL) + return (SPObject*)rv; + else + return NULL; } sigc::connection SPDocument::connectIdChanged(gchar const *id, -- cgit v1.2.3 From 47df2f918a30880162874991c71bd9bc6368906c Mon Sep 17 00:00:00 2001 From: Martin Sucha Date: Sun, 3 Apr 2011 00:24:03 +0200 Subject: Fix setting canvas margins when using "Resize page to drawing or selection" (bzr r10145) --- src/document.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index 67ce3e26a..c9b822ce6 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -632,9 +632,9 @@ void SPDocument::fitToRect(Geom::Rect const &rect, bool with_margins) margin_units = &px; } margin_top = nv->getMarginLength("fit-margin-top",margin_units, &px, w, h, false); - margin_top = nv->getMarginLength("fit-margin-left",margin_units, &px, w, h, true); - margin_top = nv->getMarginLength("fit-margin-right",margin_units, &px, w, h, true); - margin_top = nv->getMarginLength("fit-margin-bottom",margin_units, &px, w, h, false); + margin_left = nv->getMarginLength("fit-margin-left",margin_units, &px, w, h, true); + margin_right = nv->getMarginLength("fit-margin-right",margin_units, &px, w, h, true); + margin_bottom = nv->getMarginLength("fit-margin-bottom",margin_units, &px, w, h, false); } } -- cgit v1.2.3 From f3756ff85a32f4b2a0771d0ac3bd78a69535395f Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Fri, 3 Jun 2011 11:44:52 +0100 Subject: Use generic headers in preparation for GTK+ 3 transition Fixed bugs: - https://launchpad.net/bugs/792263 (bzr r10252.1.1) --- src/document.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index c9b822ce6..b9c3fe9ff 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -37,7 +37,7 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif -#include +#include #include #include -- cgit v1.2.3 From 3638efba5bec8a6afc9211aa6bbe289767d20b38 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Fri, 3 Jun 2011 19:45:55 -0700 Subject: Removed outdated/unsafe SP_DOCUMENT_DEFS macro and reduced usage of SP_ROOT() gtk type function/macro. (bzr r10254) --- src/document.cpp | 62 +++++++++++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 32 deletions(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index c9b822ce6..22cfa5663 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -214,6 +214,11 @@ SPDocument::~SPDocument() { //delete this->_whiteboard_session_manager; } +SPDefs *SPDocument::getDefs() +{ + return root->defs; +} + Persp3D * SPDocument::getCurrentPersp3D() { // Check if current_persp3d is still valid @@ -243,8 +248,7 @@ SPDocument::setCurrentPersp3D(Persp3D * const persp) { void SPDocument::getPerspectivesInDefs(std::vector &list) const { - SPDefs *defs = SP_ROOT(this->root)->defs; - for (SPObject *i = defs->firstChild(); i; i = i->getNext() ) { + for (SPObject *i = root->defs->firstChild(); i; i = i->getNext() ) { if (SP_IS_PERSP3D(i)) { list.push_back(SP_PERSP3D(i)); } @@ -348,7 +352,7 @@ SPDocument *SPDocument::createDoc(Inkscape::XML::Document *rdoc, rroot->setAttribute("baseProfile", NULL); // creating namedview - if (!sp_item_group_get_child_by_name((SPGroup *) document->root, NULL, "sodipodi:namedview")) { + if (!sp_item_group_get_child_by_name(document->root, NULL, "sodipodi:namedview")) { // if there's none in the document already, Inkscape::XML::Node *rnew = NULL; @@ -388,13 +392,12 @@ SPDocument *SPDocument::createDoc(Inkscape::XML::Document *rdoc, Inkscape::GC::release(rnew); } - /* Defs */ - if (!SP_ROOT(document->root)->defs) { - Inkscape::XML::Node *r; - r = rdoc->createElement("svg:defs"); + // Defs + if (!document->root->defs) { + Inkscape::XML::Node *r = rdoc->createElement("svg:defs"); rroot->addChild(r, NULL); Inkscape::GC::release(r); - g_assert(SP_ROOT(document->root)->defs); + g_assert(document->root->defs); } /* Default RDF */ @@ -520,17 +523,15 @@ gdouble SPDocument::getWidth() const g_return_val_if_fail(this->priv != NULL, 0.0); g_return_val_if_fail(this->root != NULL, 0.0); - SPRoot *root = SP_ROOT(this->root); - - if (root->width.unit == SVGLength::PERCENT && root->viewBox_set) - return root->viewBox.x1 - root->viewBox.x0; - return root->width.computed; + gdouble result = root->width.computed; + if (root->width.unit == SVGLength::PERCENT && root->viewBox_set) { + result = root->viewBox.x1 - root->viewBox.x0; + } + return result; } void SPDocument::setWidth(gdouble width, const SPUnit *unit) { - SPRoot *root = SP_ROOT(this->root); - if (root->width.unit == SVGLength::PERCENT && root->viewBox_set) { // set to viewBox= root->viewBox.x1 = root->viewBox.x0 + sp_units_get_pixels (width, *unit); } else { // set to width= @@ -555,8 +556,6 @@ void SPDocument::setWidth(gdouble width, const SPUnit *unit) void SPDocument::setHeight(gdouble height, const SPUnit *unit) { - SPRoot *root = SP_ROOT(this->root); - if (root->height.unit == SVGLength::PERCENT && root->viewBox_set) { // set to viewBox= root->viewBox.y1 = root->viewBox.y0 + sp_units_get_pixels (height, *unit); } else { // set to height= @@ -584,11 +583,11 @@ gdouble SPDocument::getHeight() const g_return_val_if_fail(this->priv != NULL, 0.0); g_return_val_if_fail(this->root != NULL, 0.0); - SPRoot *root = SP_ROOT(this->root); - - if (root->height.unit == SVGLength::PERCENT && root->viewBox_set) - return root->viewBox.y1 - root->viewBox.y0; - return root->height.computed; + gdouble result = root->height.computed; + if (root->height.unit == SVGLength::PERCENT && root->viewBox_set) { + result = root->viewBox.y1 - root->viewBox.y0; + } + return result; } Geom::Point SPDocument::getDimensions() const @@ -649,7 +648,7 @@ void SPDocument::fitToRect(Geom::Rect const &rect, bool with_margins) Geom::Translate const tr( Geom::Point(0, old_height - rect_with_margins.height()) - to_2geom(rect_with_margins.min())); - SP_GROUP(root)->translateChildItems(tr); + root->translateChildItems(tr); if(nv) { Geom::Translate tr2(-rect_with_margins.min()); @@ -922,17 +921,16 @@ void SPDocument::requestModified() } } -void -sp_document_setup_viewport (SPDocument *doc, SPItemCtx *ctx) +void SPDocument::setupViewport(SPItemCtx *ctx) { ctx->ctx.flags = 0; ctx->i2doc = Geom::identity(); - /* Set up viewport in case svg has it defined as percentages */ - if (SP_ROOT(doc->root)->viewBox_set) { // if set, take from viewBox - ctx->vp.x0 = SP_ROOT(doc->root)->viewBox.x0; - ctx->vp.y0 = SP_ROOT(doc->root)->viewBox.y0; - ctx->vp.x1 = SP_ROOT(doc->root)->viewBox.x1; - ctx->vp.y1 = SP_ROOT(doc->root)->viewBox.y1; + // Set up viewport in case svg has it defined as percentages + if (root->viewBox_set) { // if set, take from viewBox + ctx->vp.x0 = root->viewBox.x0; + ctx->vp.y0 = root->viewBox.y0; + ctx->vp.x1 = root->viewBox.x1; + ctx->vp.y1 = root->viewBox.y1; } else { // as a last resort, set size to A4 ctx->vp.x0 = 0.0; ctx->vp.y0 = 0.0; @@ -954,7 +952,7 @@ SPDocument::_updateDocument() if (this->root->uflags || this->root->mflags) { if (this->root->uflags) { SPItemCtx ctx; - sp_document_setup_viewport (this, &ctx); + setupViewport(&ctx); bool saved = DocumentUndo::getUndoSensitive(this); DocumentUndo::setUndoSensitive(this, false); -- cgit v1.2.3 From ab143333746e25648b253f13c0539adff089b1b6 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Fri, 24 Jun 2011 00:22:07 +0200 Subject: Remove more of libnr (bzr r10347.1.2) --- src/document.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index 90fc4c635..5bcf1bf40 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -40,6 +40,7 @@ #include #include #include +#include <2geom/transforms.h> #include "desktop.h" #include "dir-util.h" @@ -647,7 +648,7 @@ void SPDocument::fitToRect(Geom::Rect const &rect, bool with_margins) Geom::Translate const tr( Geom::Point(0, old_height - rect_with_margins.height()) - - to_2geom(rect_with_margins.min())); + - rect_with_margins.min()); root->translateChildItems(tr); if(nv) { -- cgit v1.2.3 From 7c08a0a0c893ca60e6844871e671ead34bf09edb Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sat, 30 Jul 2011 20:50:46 +0200 Subject: Memory leaks fix / code cleanup (bzr r10519) --- src/document.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index 5bcf1bf40..441a5876f 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -312,6 +312,15 @@ SPDocument *SPDocument::createDoc(Inkscape::XML::Document *rdoc, document->rdoc = rdoc; document->rroot = rroot; + if (document->uri){ + g_free(document->uri); + } + if (document->base){ + g_free(document->base); + } + if (document->name){ + g_free(document->name); + } #ifndef WIN32 document->uri = prepend_current_dir_if_relative(uri); #else @@ -503,7 +512,7 @@ SPDocument *SPDocument::createNewDocFromMem(gchar const *buffer, gint length, un name = g_strdup_printf(_("Memory document %d"), ++doc_count); doc = createDoc(rdoc, NULL, NULL, name, keepalive); - + g_free(name); return doc; } -- cgit v1.2.3 From d7cc3ab4cde91c261e13a2a208ed125227e6b30f Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sat, 30 Jul 2011 21:48:59 -0700 Subject: Added overload for getObjectById(). Added safety by zeroing out invalid points (prevents accidental use of stale pointers). (bzr r10521) --- src/document.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index 441a5876f..4d1d8780a 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -314,12 +314,15 @@ SPDocument *SPDocument::createDoc(Inkscape::XML::Document *rdoc, if (document->uri){ g_free(document->uri); + document->uri = 0; } if (document->base){ g_free(document->base); + document->base = 0; } if (document->name){ g_free(document->name); + document->name = 0; } #ifndef WIN32 document->uri = prepend_current_dir_if_relative(uri); @@ -852,6 +855,11 @@ SPDocument::removeUndoObserver(Inkscape::UndoStackObserver& observer) this->priv->undoStackObservers.remove(observer); } +SPObject *SPDocument::getObjectById(Glib::ustring const &id) const +{ + return getObjectById( id.c_str() ); +} + SPObject *SPDocument::getObjectById(gchar const *id) const { g_return_val_if_fail(id != NULL, NULL); -- cgit v1.2.3 From ef9e5dcdd29b794de438155f43a0a3374b4d33a3 Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Sat, 30 Jul 2011 22:21:21 -0700 Subject: Refactored createnewDocFromMem() to be C++ instead of C, removing potential for memory leaks. (bzr r10523) --- src/document.cpp | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index 4d1d8780a..b699f8afa 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -497,25 +497,21 @@ SPDocument *SPDocument::createNewDoc(gchar const *uri, unsigned int keepalive, b SPDocument *SPDocument::createNewDocFromMem(gchar const *buffer, gint length, unsigned int keepalive) { - SPDocument *doc; - Inkscape::XML::Document *rdoc; - Inkscape::XML::Node *rroot; - gchar *name; - - rdoc = sp_repr_read_mem(buffer, length, SP_SVG_NS_URI); - - /* If it cannot be loaded, return NULL without warning */ - if (rdoc == NULL) return NULL; - - rroot = rdoc->root(); - /* If xml file is not svg, return NULL without warning */ - /* fixme: destroy document */ - if (strcmp(rroot->name(), "svg:svg") != 0) return NULL; - - name = g_strdup_printf(_("Memory document %d"), ++doc_count); + SPDocument *doc = 0; + + Inkscape::XML::Document *rdoc = sp_repr_read_mem(buffer, length, SP_SVG_NS_URI); + if ( rdoc ) { + // Only continue to create a non-null doc if it could be loaded + Inkscape::XML::Node *rroot = rdoc->root(); + if ( strcmp(rroot->name(), "svg:svg") != 0 ) { + // If xml file is not svg, return NULL without warning + // TODO fixme: destroy document + } else { + Glib::ustring name = Glib::ustring::compose( _("Memory document %1"), ++doc_count ); + doc = createDoc(rdoc, NULL, NULL, name.c_str(), keepalive); + } + } - doc = createDoc(rdoc, NULL, NULL, name, keepalive); - g_free(name); return doc; } -- cgit v1.2.3 From 4dd33aa4d5c57706c7f64f63391174954160a308 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 6 Aug 2011 14:18:32 +0200 Subject: Rewrite NRArenaItem hierarchy into C++ (bzr r10347.1.21) --- src/document.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index 5bcf1bf40..64f4ea92a 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -44,7 +44,7 @@ #include "desktop.h" #include "dir-util.h" -#include "display/nr-arena-item.h" +#include "display/drawing-item.h" #include "document-private.h" #include "helper/units.h" #include "inkscape-private.h" @@ -1113,8 +1113,8 @@ SPItem *SPDocument::getItemFromListAtPointBottom(unsigned int dkey, SPGroup *gro for ( SPObject *o = group->firstChild() ; o && !bottomMost; o = o->getNext() ) { if ( SP_IS_ITEM(o) ) { SPItem *item = SP_ITEM(o); - NRArenaItem *arenaitem = item->get_arenaitem(dkey); - if (arenaitem && nr_arena_item_invoke_pick(arenaitem, p, delta, 1) != NULL + Inkscape::DrawingItem *arenaitem = item->get_arenaitem(dkey); + if (arenaitem && arenaitem->pick(p, delta, 1) != NULL && (take_insensitive || item->isVisibleAndUnlocked(dkey))) { if (g_slist_find((GSList *) list, item) != NULL) { bottomMost = item; @@ -1167,10 +1167,10 @@ SPItem *find_item_at_point(unsigned int dkey, SPGroup *group, Geom::Point const } } else { SPItem *child = SP_ITEM(o); - NRArenaItem *arenaitem = child->get_arenaitem(dkey); + Inkscape::DrawingItem *arenaitem = child->get_arenaitem(dkey); // seen remembers the last (topmost) of items pickable at this point - if (arenaitem && nr_arena_item_invoke_pick(arenaitem, p, delta, 1) != NULL + if (arenaitem && arenaitem->pick(p, delta, 1) != NULL && (take_insensitive || child->isVisibleAndUnlocked(dkey))) { seen = child; } @@ -1201,10 +1201,10 @@ SPItem *find_group_at_point(unsigned int dkey, SPGroup *group, Geom::Point const } if (SP_IS_GROUP(o) && SP_GROUP(o)->effectiveLayerMode(dkey) != SPGroup::LAYER ) { SPItem *child = SP_ITEM(o); - NRArenaItem *arenaitem = child->get_arenaitem(dkey); + Inkscape::DrawingItem *arenaitem = child->get_arenaitem(dkey); // seen remembers the last (topmost) of groups pickable at this point - if (arenaitem && nr_arena_item_invoke_pick(arenaitem, p, delta, 1) != NULL) { + if (arenaitem && arenaitem->pick(p, delta, 1) != NULL) { seen = child; } } -- cgit v1.2.3 From 72cc39b9f0b340548f395c7f61ca9662b34aea09 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 27 Aug 2011 11:04:37 +0200 Subject: Refactor SPItem bounding box methods: remove NRRect usage and make code using them more obvious. Fix filter region computation. (bzr r10582.1.1) --- src/document.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index 72f92bd17..cf2474fe5 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -1086,7 +1086,7 @@ static GSList *find_items_in_area(GSList *s, SPGroup *group, unsigned int dkey, s = find_items_in_area(s, SP_GROUP(o), dkey, area, test); } else { SPItem *child = SP_ITEM(o); - Geom::OptRect box = child->getBboxDesktop(); + Geom::OptRect box = child->desktopVisualBounds(); if ( box && test(area, *box) && (take_insensitive || child->isVisibleAndUnlocked(dkey))) { s = g_slist_append(s, child); } -- cgit v1.2.3 From 24526cceccb4ed103a6324756476c64efb3fb5dd Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 27 Aug 2011 16:58:22 +0200 Subject: Remove all NRRect use. (bzr r10582.1.5) --- src/document.cpp | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index cf2474fe5..d45041296 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -534,7 +534,7 @@ gdouble SPDocument::getWidth() const gdouble result = root->width.computed; if (root->width.unit == SVGLength::PERCENT && root->viewBox_set) { - result = root->viewBox.x1 - root->viewBox.x0; + result = root->viewBox.width(); } return result; } @@ -542,7 +542,7 @@ gdouble SPDocument::getWidth() const void SPDocument::setWidth(gdouble width, const SPUnit *unit) { if (root->width.unit == SVGLength::PERCENT && root->viewBox_set) { // set to viewBox= - root->viewBox.x1 = root->viewBox.x0 + sp_units_get_pixels (width, *unit); + root->viewBox.setMax(Geom::Point(root->viewBox.left() + sp_units_get_pixels (width, *unit), root->viewBox.bottom())); } else { // set to width= gdouble old_computed = root->width.computed; root->width.computed = sp_units_get_pixels (width, *unit); @@ -557,16 +557,28 @@ void SPDocument::setWidth(gdouble width, const SPUnit *unit) } if (root->viewBox_set) - root->viewBox.x1 = root->viewBox.x0 + (root->width.computed / old_computed) * (root->viewBox.x1 - root->viewBox.x0); + root->viewBox.setMax(Geom::Point(root->viewBox.left() + (root->width.computed / old_computed) * root->viewBox.width(), root->viewBox.bottom())); } root->updateRepr(); } +gdouble SPDocument::getHeight() const +{ + g_return_val_if_fail(this->priv != NULL, 0.0); + g_return_val_if_fail(this->root != NULL, 0.0); + + gdouble result = root->height.computed; + if (root->height.unit == SVGLength::PERCENT && root->viewBox_set) { + result = root->viewBox.height(); + } + return result; +} + void SPDocument::setHeight(gdouble height, const SPUnit *unit) { if (root->height.unit == SVGLength::PERCENT && root->viewBox_set) { // set to viewBox= - root->viewBox.y1 = root->viewBox.y0 + sp_units_get_pixels (height, *unit); + root->viewBox.setMax(Geom::Point(root->viewBox.right(), root->viewBox.top() + sp_units_get_pixels (height, *unit))); } else { // set to height= gdouble old_computed = root->height.computed; root->height.computed = sp_units_get_pixels (height, *unit); @@ -581,24 +593,12 @@ void SPDocument::setHeight(gdouble height, const SPUnit *unit) } if (root->viewBox_set) - root->viewBox.y1 = root->viewBox.y0 + (root->height.computed / old_computed) * (root->viewBox.y1 - root->viewBox.y0); + root->viewBox.setMax(Geom::Point(root->viewBox.right(), root->viewBox.top() + (root->height.computed / old_computed) * root->viewBox.height())); } root->updateRepr(); } -gdouble SPDocument::getHeight() const -{ - g_return_val_if_fail(this->priv != NULL, 0.0); - g_return_val_if_fail(this->root != NULL, 0.0); - - gdouble result = root->height.computed; - if (root->height.unit == SVGLength::PERCENT && root->viewBox_set) { - result = root->viewBox.y1 - root->viewBox.y0; - } - return result; -} - Geom::Point SPDocument::getDimensions() const { return Geom::Point(getWidth(), getHeight()); @@ -941,15 +941,9 @@ void SPDocument::setupViewport(SPItemCtx *ctx) ctx->i2doc = Geom::identity(); // Set up viewport in case svg has it defined as percentages if (root->viewBox_set) { // if set, take from viewBox - ctx->vp.x0 = root->viewBox.x0; - ctx->vp.y0 = root->viewBox.y0; - ctx->vp.x1 = root->viewBox.x1; - ctx->vp.y1 = root->viewBox.y1; + ctx->viewport = root->viewBox; } else { // as a last resort, set size to A4 - ctx->vp.x0 = 0.0; - ctx->vp.y0 = 0.0; - ctx->vp.x1 = 210 * PX_PER_MM; - ctx->vp.y1 = 297 * PX_PER_MM; + ctx->viewport = Geom::Rect::from_xywh(0, 0, 210 * PX_PER_MM, 297 * PX_PER_MM); } ctx->i2vp = Geom::identity(); } -- cgit v1.2.3 From 2633767789e4264b13ef91a684accf734fb4e94f Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Wed, 26 Oct 2011 21:55:51 -0700 Subject: Fixing more broken and split doc comments. (bzr r10697) --- src/document.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index d45041296..6035ea557 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -1,4 +1,4 @@ -/** \file +/* * SPDocument manipulation * * Authors: -- cgit v1.2.3 From 14b6891e5d84dc76829749d888e9dd769c037ebb Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Tue, 20 Dec 2011 23:07:22 +0100 Subject: when resizing page, move the origin of the grids too. This way all objects will stay aligned to the grids. (bzr r10787) --- src/document.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index 6035ea557..ce8e6d125 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -662,6 +662,7 @@ void SPDocument::fitToRect(Geom::Rect const &rect, bool with_margins) if(nv) { Geom::Translate tr2(-rect_with_margins.min()); nv->translateGuides(tr2); + nv->translateGrids(tr2); // update the viewport so the drawing appears to stay where it was nv->scrollAllDesktops(-tr2[0], tr2[1], false); -- cgit v1.2.3