From eb6473340d55ce97b87d5ae6336afb5c1faea303 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Fri, 21 Feb 2014 13:40:25 +0100 Subject: Symbols dialog: update currentDesktop and currentDocument when document replaced. (bzr r13048) --- src/ui/dialog/symbols.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 98754fb4f..62a2f8572 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -381,8 +381,10 @@ void SymbolsDialog::selectionChanged(Inkscape::Selection *selection) { } } -void SymbolsDialog::documentReplaced(SPDesktop */*desktop*/, SPDocument */*document*/) +void SymbolsDialog::documentReplaced(SPDesktop *desktop, SPDocument *document) { + currentDesktop = desktop; + currentDocument = document; rebuild(); } -- cgit v1.2.3 From 12e03b939f58c6b6dc5495e0559fe47d7a73bb48 Mon Sep 17 00:00:00 2001 From: David Mathog Date: Sat, 22 Feb 2014 10:03:23 +0100 Subject: Fix 'preserveAspectRatio' attribute of bitmap images in EMF/WMF import/export (bug #1278645). Fixed bugs: - https://launchpad.net/bugs/1278645 (bzr r13049) --- src/extension/internal/emf-inout.cpp | 2 ++ src/extension/internal/emf-print.cpp | 10 ++++----- src/extension/internal/wmf-inout.cpp | 10 +++++---- src/extension/internal/wmf-print.cpp | 16 ++++++++------ src/sp-image.cpp | 42 ++++++++---------------------------- 5 files changed, 32 insertions(+), 48 deletions(-) (limited to 'src') diff --git a/src/extension/internal/emf-inout.cpp b/src/extension/internal/emf-inout.cpp index 276dee362..b73c5e9e5 100644 --- a/src/extension/internal/emf-inout.cpp +++ b/src/extension/internal/emf-inout.cpp @@ -554,6 +554,7 @@ uint32_t Emf::add_image(PEMF_CALLBACK_DATA d, void *pEmr, uint32_t cbBits, uint else { *(d->defs) += " xlink:href=\"data:image/png;base64,"; } *(d->defs) += base64String; *(d->defs) += "\"\n"; + *(d->defs) += " preserveAspectRatio=\"none\"\n"; *(d->defs) += " />\n"; @@ -1531,6 +1532,7 @@ void Emf::common_image_extraction(PEMF_CALLBACK_DATA d, void *pEmr, tmp_image << "\"\n height=\"" << dh << "\"\n width=\"" << dw << "\"\n"; tmp_image << " transform=" << current_matrix(d, dx, dy, 1); // calculate appropriate offset + tmp_image << " preserveAspectRatio=\"none\"\n"; tmp_image << "/> \n"; *(d->outsvg) += tmp_image.str().c_str(); diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp index 6d5bb6f4b..c103100b3 100644 --- a/src/extension/internal/emf-print.cpp +++ b/src/extension/internal/emf-print.cpp @@ -1562,7 +1562,7 @@ unsigned int PrintEmf::image( unsigned int w, /** width of bitmap */ unsigned int h, /** height of bitmap */ unsigned int rs, /** row stride (normally w*4) */ - Geom::Affine const &/*tf_ignore*/, /** WRONG affine transform, use the one from m_tr_stack */ + Geom::Affine const &tf_rect, /** affine transform only used for defining location and size of rect, for all other tranforms, use the one from m_tr_stack */ SPStyle const *style) /** provides indirect link to image object */ { double x1, y1, dw, dh; @@ -1574,10 +1574,10 @@ unsigned int PrintEmf::image( g_error("Fatal programming error in PrintEmf::image at EMRHEADER"); } - x1 = atof(style->object->getAttribute("x")); - y1 = atof(style->object->getAttribute("y")); - dw = atof(style->object->getAttribute("width")); - dh = atof(style->object->getAttribute("height")); + x1 = tf_rect[4]; + y1 = tf_rect[5]; + dw = ((double) w) * tf_rect[0]; + dh = ((double) h) * tf_rect[3]; Geom::Point pLL(x1, y1); Geom::Point pLL2 = pLL * tf; //location of LL corner in Inkscape coordinates diff --git a/src/extension/internal/wmf-inout.cpp b/src/extension/internal/wmf-inout.cpp index fc54350df..3c348f5c4 100644 --- a/src/extension/internal/wmf-inout.cpp +++ b/src/extension/internal/wmf-inout.cpp @@ -525,6 +525,7 @@ uint32_t Wmf::add_dib_image(PWMF_CALLBACK_DATA d, const char *dib, uint32_t iUsa else { *(d->defs) += " xlink:href=\"data:image/png;base64,"; } *(d->defs) += base64String; *(d->defs) += "\"\n"; + *(d->defs) += " preserveAspectRatio=\"none\"\n"; *(d->defs) += " />\n"; @@ -619,6 +620,7 @@ uint32_t Wmf::add_bm16_image(PWMF_CALLBACK_DATA d, U_BITMAP16 Bm16, const char * *(d->defs) += " xlink:href=\"data:image/png;base64,"; *(d->defs) += base64String; *(d->defs) += "\"\n"; + *(d->defs) += " preserveAspectRatio=\"none\"\n"; *(d->defs) += " />\n"; @@ -1269,6 +1271,7 @@ void Wmf::common_dib_to_image(PWMF_CALLBACK_DATA d, const char *dib, SVGOStringStream tmp_image; int dibparams; + tmp_image << "\n\t outsvg) += tmp_image.str().c_str(); + tmp_image << " preserveAspectRatio=\"none\"\n"; + tmp_image << "/> \n"; - *(d->outsvg) += "/> \n"; + *(d->outsvg) += tmp_image.str().c_str(); *(d->path) = ""; } diff --git a/src/extension/internal/wmf-print.cpp b/src/extension/internal/wmf-print.cpp index 1c7b42c82..32c7ac0bd 100644 --- a/src/extension/internal/wmf-print.cpp +++ b/src/extension/internal/wmf-print.cpp @@ -1103,7 +1103,7 @@ unsigned int PrintWmf::image( unsigned int w, /** width of bitmap */ unsigned int h, /** height of bitmap */ unsigned int rs, /** row stride (normally w*4) */ - Geom::Affine const & /*tf_ignore*/, /** WRONG affine transform, use the one from m_tr_stack */ + Geom::Affine const &tf_rect, /** affine transform only used for defining location and size of rect, for all other tranforms, use the one from m_tr_stack */ SPStyle const *style) /** provides indirect link to image object */ { double x1, y1, dw, dh; @@ -1115,15 +1115,19 @@ unsigned int PrintWmf::image( g_error("Fatal programming error in PrintWmf::image at EMRHEADER"); } - x1 = g_ascii_strtod(style->object->getAttribute("x"), NULL); - y1 = g_ascii_strtod(style->object->getAttribute("y"), NULL); - dw = g_ascii_strtod(style->object->getAttribute("width"), NULL); - dh = g_ascii_strtod(style->object->getAttribute("height"), NULL); + x1 = tf_rect[4]; + y1 = tf_rect[5]; + dw = ((double) w) * tf_rect[0]; + dh = ((double) h) * tf_rect[3]; Geom::Point pLL(x1, y1); Geom::Point pLL2 = pLL * tf; //location of LL corner in Inkscape coordinates + /* adjust scale of w and h. This works properly when there is no rotation. The values are + a bit strange when there is rotation, but since WMF cannot handle rotation in any case, all + answers are equally wrong. + */ Geom::Point pWH(dw, dh); - Geom::Point pWH2 = pWH * tf.withoutTranslation(); //adjust scale + Geom::Point pWH2 = pWH * tf.withoutTranslation(); char *px; uint32_t cbPx; diff --git a/src/sp-image.cpp b/src/sp-image.cpp index 5f630f7b7..2c20331a9 100644 --- a/src/sp-image.cpp +++ b/src/sp-image.cpp @@ -500,39 +500,15 @@ void SPImage::print(SPPrintContext *ctx) { int w = pb->width(); int h = pb->height(); int rs = pb->rowstride(); - //int pixskip = gdk_pixbuf_get_n_channels(pb) * gdk_pixbuf_get_bits_per_sample(pb) / 8; - int pixskip = 4; - - if (this->aspect_align == SP_ASPECT_NONE) { - Geom::Affine t; - Geom::Translate tp(this->x.computed, this->y.computed); - Geom::Scale s(this->width.computed, -this->height.computed); - Geom::Translate ti(0.0, -1.0); - t = s * tp; - t = ti * t; - sp_print_image_R8G8B8A8_N(ctx, px, w, h, rs, t, this->style); - } else { // preserveAspectRatio - double vw = this->width.computed / this->sx; - double vh = this->height.computed / this->sy; - - int trimwidth = std::min(w, ceil(this->width.computed / vw * w)); - int trimheight = std::min(h, ceil(this->height.computed / vh * h)); - int trimx = std::max(0, floor((this->x.computed - this->ox) / vw * w)); - int trimy = std::max(0, floor((this->y.computed - this->oy) / vh * h)); - - double vx = std::max(this->ox, this->x.computed); - double vy = std::max(this->oy, this->y.computed); - double vcw = std::min(this->width.computed, vw); - double vch = std::min(this->height.computed, vh); - - Geom::Affine t; - Geom::Translate tp(vx, vy); - Geom::Scale s(vcw, -vch); - Geom::Translate ti(0.0, -1.0); - t = s * tp; - t = ti * t; - sp_print_image_R8G8B8A8_N(ctx, px + trimx*pixskip + trimy*rs, trimwidth, trimheight, rs, t, this->style); - } + + double vx = this->ox; + double vy = this->oy; + + Geom::Affine t; + Geom::Translate tp(vx, vy); + Geom::Scale s(this->sx, this->sy); + t = s * tp; + sp_print_image_R8G8B8A8_N(ctx, px, w, h, rs, t, this->style); delete pb; } } -- cgit v1.2.3 From b3dad97ff32d34dc38ce51ebbdc0e9555a9ce5e6 Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Sat, 22 Feb 2014 16:37:43 -0500 Subject: offset of viewBox on document unit change (Bug 1280684) Fixed bugs: - https://launchpad.net/bugs/1280684 (bzr r13050) --- src/ui/dialog/document-properties.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index d344fb1d6..0411c789c 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -1734,8 +1734,14 @@ void DocumentProperties::onDocUnitChange() prefs->setBool("/options/transform/gradient", true); { ShapeEditor::blockSetItem(true); + gdouble viewscale = doc->getWidth().value("px")/doc->getRoot()->viewBox.width(); + if (doc->getHeight().value("px")/doc->getRoot()->viewBox.height() < viewscale) + viewscale = doc->getHeight().value("px")/doc->getRoot()->viewBox.height(); gdouble scale = Inkscape::Util::Quantity::convert(1, old_doc_unit, doc_unit); - doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(0, doc->getHeight().value("px"))); + doc->getRoot()->scaleChildItemsRec(Geom::Scale(scale), Geom::Point(-viewscale*doc->getRoot()->viewBox.min()[Geom::X] + + (doc->getWidth().value("px") - viewscale*doc->getRoot()->viewBox.width())/2, + viewscale*doc->getRoot()->viewBox.min()[Geom::Y] + + (doc->getHeight().value("px") + viewscale*doc->getRoot()->viewBox.height())/2)); ShapeEditor::blockSetItem(false); } prefs->setBool("/options/transform/stroke", transform_stroke); -- cgit v1.2.3 From 9657576ce874d32248bbbc2dc204ac2fb6121dea Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sun, 23 Feb 2014 20:30:28 +0100 Subject: Fix for selcue settings. Fixed bugs: - https://launchpad.net/bugs/1274659 (bzr r13051) --- src/ui/tools/dropper-tool.cpp | 2 ++ src/ui/tools/freehand-base.cpp | 2 ++ src/ui/tools/measure-tool.cpp | 2 ++ src/ui/tools/text-tool.cpp | 2 ++ src/ui/tools/zoom-tool.cpp | 2 ++ 5 files changed, 10 insertions(+) (limited to 'src') diff --git a/src/ui/tools/dropper-tool.cpp b/src/ui/tools/dropper-tool.cpp index 9c47b50e9..88ed342df 100644 --- a/src/ui/tools/dropper-tool.cpp +++ b/src/ui/tools/dropper-tool.cpp @@ -152,6 +152,8 @@ void DropperTool::finish() { #endif cursor_dropper_fill = NULL; } + + ToolBase::finish(); } /** diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index c3c269743..1e0e6b3b6 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -167,6 +167,8 @@ void FreehandBase::finish() { } spdc_free_colors(this); + + ToolBase::finish(); } void FreehandBase::set(const Inkscape::Preferences::Entry& /*value*/) { diff --git a/src/ui/tools/measure-tool.cpp b/src/ui/tools/measure-tool.cpp index 0d823dfda..4d7f1e074 100644 --- a/src/ui/tools/measure-tool.cpp +++ b/src/ui/tools/measure-tool.cpp @@ -254,6 +254,8 @@ void MeasureTool::finish() { sp_canvas_item_ungrab(this->grabbed, GDK_CURRENT_TIME); this->grabbed = NULL; } + + ToolBase::finish(); } //void MeasureTool::setup() { diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp index 9b5ab1016..ba68c7829 100644 --- a/src/ui/tools/text-tool.cpp +++ b/src/ui/tools/text-tool.cpp @@ -266,6 +266,8 @@ void TextTool::finish() { } this->text_selection_quads.clear(); + + ToolBase::finish(); } bool TextTool::item_handler(SPItem* item, GdkEvent* event) { diff --git a/src/ui/tools/zoom-tool.cpp b/src/ui/tools/zoom-tool.cpp index d4ede1053..0996e6cf4 100644 --- a/src/ui/tools/zoom-tool.cpp +++ b/src/ui/tools/zoom-tool.cpp @@ -63,6 +63,8 @@ void ZoomTool::finish() { sp_canvas_item_ungrab(this->grabbed, GDK_CURRENT_TIME); this->grabbed = NULL; } + + ToolBase::finish(); } void ZoomTool::setup() { -- cgit v1.2.3 From 457a6606406c6b5830fc6990866b1d2cd847602b Mon Sep 17 00:00:00 2001 From: Alvin Penner Date: Sun, 23 Feb 2014 19:48:29 -0500 Subject: fix typos in page-sizer (Bug 1240308) Fixed bugs: - https://launchpad.net/bugs/1240308 (bzr r13052) --- src/ui/widget/page-sizer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index b13567adb..b35f35403 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -555,7 +555,7 @@ PageSizer::find_paper_size (Inkscape::Util::Quantity w, Inkscape::Util::Quantity { double smaller = w.quantity; double larger = h.quantity; - if ( h < w ) { + if ( h.quantity < w.quantity ) { smaller = h.quantity; larger = w.quantity; } @@ -568,7 +568,7 @@ PageSizer::find_paper_size (Inkscape::Util::Quantity w, Inkscape::Util::Quantity double smallX = Inkscape::Util::Quantity::convert(paper.smaller, paper.unit, w.unit); double largeX = Inkscape::Util::Quantity::convert(paper.larger, paper.unit, w.unit); - g_return_val_if_fail(smallX <= largeX, _paperSizeListStore->children().end()); + g_return_val_if_fail(smallX < largeX + 0.001, _paperSizeListStore->children().end()); if ((std::abs(smaller - smallX) <= 0.1) && (std::abs(larger - largeX) <= 0.1) ) { -- cgit v1.2.3 From f6060c9447e6f2e5a70e957c19bd4eb1ae4babef Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 24 Feb 2014 20:32:07 +0100 Subject: inspired by r13052, fix up the code to hopefully work when someone has different units for height and width of the page. Fixed bugs: - https://launchpad.net/bugs/1240308 (bzr r13053) --- src/ui/widget/page-sizer.cpp | 32 ++++++++++++++++++-------------- src/util/units.cpp | 13 ++++++++++--- src/util/units.h | 8 +++++++- 3 files changed, 35 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index b35f35403..eae0d4a95 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -547,36 +547,40 @@ PageSizer::updateFitMarginsUI(Inkscape::XML::Node *nv_repr) /** * Returns an iterator pointing to a row in paperSizeListStore which - * contains a paper of the specified size (specified in px), or + * contains a paper of the specified size, or * paperSizeListStore->children().end() if no such paper exists. + * + * The code is not tested for the case where w and h have different units. */ Gtk::ListStore::iterator PageSizer::find_paper_size (Inkscape::Util::Quantity w, Inkscape::Util::Quantity h) const { - double smaller = w.quantity; - double larger = h.quantity; - if ( h.quantity < w.quantity ) { - smaller = h.quantity; larger = w.quantity; + using Inkscape::Util::Quantity; + using std::swap; + + // The code below assumes that w < h, so make sure that's the case: + if ( h < w ) { + swap(h,w); } - g_return_val_if_fail(smaller <= larger, _paperSizeListStore->children().end()); + g_return_val_if_fail(w <= h, _paperSizeListStore->children().end()); std::map::const_iterator iter; for (iter = _paperSizeTable.begin() ; iter != _paperSizeTable.end() ; ++iter) { PaperSize paper = iter->second; - double smallX = Inkscape::Util::Quantity::convert(paper.smaller, paper.unit, w.unit); - double largeX = Inkscape::Util::Quantity::convert(paper.larger, paper.unit, w.unit); + Quantity smallX (paper.smaller, paper.unit); + Quantity largeX (paper.larger, paper.unit); - g_return_val_if_fail(smallX < largeX + 0.001, _paperSizeListStore->children().end()); + g_return_val_if_fail(smallX.quantity < largeX.quantity + 0.001, _paperSizeListStore->children().end()); - if ((std::abs(smaller - smallX) <= 0.1) && - (std::abs(larger - largeX) <= 0.1) ) { - Gtk::ListStore::iterator p; + if ( are_near(w, smallX, 0.1) && are_near(h, largeX, 0.1) ) { + Gtk::ListStore::iterator p = _paperSizeListStore->children().begin(); + Gtk::ListStore::iterator pend = _paperSizeListStore->children().end(); // We need to search paperSizeListStore explicitly for the // specified paper size because it is sorted in a different // way than paperSizeTable (which is sorted alphabetically) - for (p = _paperSizeListStore->children().begin(); p != _paperSizeListStore->children().end(); ++p) { + for ( ; p != pend; ++p) { if ((*p)[_paperSizeListColumns.nameColumn] == paper.name) { return p; } @@ -601,7 +605,7 @@ PageSizer::fire_fit_canvas_to_selection_or_drawing() SPDocument *doc; SPNamedView *nv; Inkscape::XML::Node *nv_repr; - + if ((doc = sp_desktop_document(SP_ACTIVE_DESKTOP)) && (nv = sp_document_namedview(doc, 0)) && (nv_repr = nv->getRepr())) { diff --git a/src/util/units.cpp b/src/util/units.cpp index 40cce028d..d2053f60b 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -505,16 +505,23 @@ double Quantity::convert(double from_dist, char const *from, char const *to) return convert(from_dist, unit_table.getUnit(from), unit_table.getUnit(to)); } -bool Quantity::operator<(Quantity const &other) const +bool Quantity::operator<(Quantity const &rhs) const { - if (unit->type != other.unit->type) { + if (unit->type != rhs.unit->type) { g_warning("Incompatible units"); return false; } - return quantity < other.value(unit); + return quantity < rhs.value(unit); } bool Quantity::operator==(Quantity const &other) const { + /** \fixme This is overly strict. I think we should change this to: + if (unit->type != other.unit->type) { + g_warning("Incompatible units"); + return false; + } + return are_near(quantity, other.value(unit)); + */ return (*unit == *other.unit) && (quantity == other.quantity); } diff --git a/src/util/units.h b/src/util/units.h index 597371369..efe1dbec7 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -16,6 +16,7 @@ #include #include #include +#include <2geom/coord.h> #include "svg/svg-length.h" #include "unordered-containers.h" @@ -112,10 +113,15 @@ public: static double convert(double from_dist, char const *from, char const *to); /** Comparison operators. */ - bool operator<(Quantity const &other) const; + bool operator<(Quantity const &rhs) const; bool operator==(Quantity const &other) const; }; +inline bool are_near(Quantity const &a, Quantity const &b, double eps=Geom::EPSILON) +{ + return Geom::are_near(a.quantity, b.value(a.unit), eps); +} + class UnitTable { public: /** -- cgit v1.2.3 From 5033a179a05667c0de3ba2cd81595f435edbc85b Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 24 Feb 2014 21:01:23 +0100 Subject: Set the order of resize handles back to what they were before r12400. Now it's possible again to access all handles for horizontal lines + geometric bbox Fixed bugs: - https://launchpad.net/bugs/1204193 (bzr r13054) --- src/seltrans-handles.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/seltrans-handles.cpp b/src/seltrans-handles.cpp index 6dd94d297..2f9fb9076 100644 --- a/src/seltrans-handles.cpp +++ b/src/seltrans-handles.cpp @@ -17,22 +17,22 @@ SPSelTransHandle const hands[] = { //center handle will be 0 so we can reference it quickly. {HANDLE_CENTER, SP_ANCHOR_CENTER, GDK_CROSSHAIR, 12, 0.5, 0.5}, //handle-type anchor-nudge cursor image x y - {HANDLE_STRETCH, SP_ANCHOR_S, GDK_TOP_SIDE, 3, 0.5, 1}, - {HANDLE_STRETCH, SP_ANCHOR_W, GDK_RIGHT_SIDE, 2, 1, 0.5}, - {HANDLE_STRETCH, SP_ANCHOR_N, GDK_BOTTOM_SIDE, 3, 0.5, 0}, - {HANDLE_STRETCH, SP_ANCHOR_E, GDK_LEFT_SIDE, 2, 0, 0.5}, {HANDLE_SCALE, SP_ANCHOR_SE, GDK_TOP_LEFT_CORNER, 0, 0, 1}, + {HANDLE_STRETCH, SP_ANCHOR_S, GDK_TOP_SIDE, 3, 0.5, 1}, {HANDLE_SCALE, SP_ANCHOR_SW, GDK_TOP_RIGHT_CORNER, 1, 1, 1}, + {HANDLE_STRETCH, SP_ANCHOR_W, GDK_RIGHT_SIDE, 2, 1, 0.5}, {HANDLE_SCALE, SP_ANCHOR_NW, GDK_BOTTOM_RIGHT_CORNER, 0, 1, 0}, + {HANDLE_STRETCH, SP_ANCHOR_N, GDK_BOTTOM_SIDE, 3, 0.5, 0}, {HANDLE_SCALE, SP_ANCHOR_NE, GDK_BOTTOM_LEFT_CORNER, 1, 0, 0}, - {HANDLE_SKEW, SP_ANCHOR_S, GDK_SB_H_DOUBLE_ARROW, 8, 0.5, 1}, - {HANDLE_SKEW, SP_ANCHOR_W, GDK_SB_V_DOUBLE_ARROW, 9, 1, 0.5}, - {HANDLE_SKEW, SP_ANCHOR_N, GDK_SB_H_DOUBLE_ARROW, 10, 0.5, 0}, - {HANDLE_SKEW, SP_ANCHOR_E, GDK_SB_V_DOUBLE_ARROW, 11, 0, 0.5}, + {HANDLE_STRETCH, SP_ANCHOR_E, GDK_LEFT_SIDE, 2, 0, 0.5}, {HANDLE_ROTATE, SP_ANCHOR_SE, GDK_EXCHANGE, 4, 0, 1}, + {HANDLE_SKEW, SP_ANCHOR_S, GDK_SB_H_DOUBLE_ARROW, 8, 0.5, 1}, {HANDLE_ROTATE, SP_ANCHOR_SW, GDK_EXCHANGE, 5, 1, 1}, + {HANDLE_SKEW, SP_ANCHOR_W, GDK_SB_V_DOUBLE_ARROW, 9, 1, 0.5}, {HANDLE_ROTATE, SP_ANCHOR_NW, GDK_EXCHANGE, 6, 1, 0}, + {HANDLE_SKEW, SP_ANCHOR_N, GDK_SB_H_DOUBLE_ARROW, 10, 0.5, 0}, {HANDLE_ROTATE, SP_ANCHOR_NE, GDK_EXCHANGE, 7, 0, 0}, + {HANDLE_SKEW, SP_ANCHOR_E, GDK_SB_V_DOUBLE_ARROW, 11, 0, 0.5}, }; /* -- cgit v1.2.3 From 0917cc6ed7207c0535360dd757705bda30410a47 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Mon, 24 Feb 2014 21:28:00 +0100 Subject: Fix infinite loop (?) by disabling saving the order of filters when they are reordered by drag&drop in the filter editor dialog. (bug 1239296) Fixed bugs: - https://launchpad.net/bugs/1239296 (bzr r13055) --- src/ui/dialog/filter-effects-dialog.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index 6a3a4c3f1..e8b09db8b 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -1515,11 +1515,16 @@ void FilterEffectsDialog::FilterModifier::on_name_edited(const Glib::ustring& pa } void FilterEffectsDialog::FilterModifier::on_filter_reorder(const Gtk::TreeModel::Path& /*path*/) { +/* The code below is bugged. Use of "object->getRepr()->setPosition(0)" is dangerous! + Writing back the reordered list to XML (reordering XML nodes) should be implemented differently. + Note that the dialog does also not update its list of filters when the order is manually changed + using the XML dialog for(Gtk::TreeModel::iterator i = _model->children().begin(); i != _model->children().end(); ++i) { SPObject* object = (*i)[_columns.filter]; - if(object && object->getRepr()) + if(object && object->getRepr()) ; object->getRepr()->setPosition(0); } +*/ } void FilterEffectsDialog::FilterModifier::on_selection_toggled(const Glib::ustring& path) -- cgit v1.2.3