diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-11-03 00:55:01 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2018-05-09 19:42:10 +0000 |
| commit | 61cbbcbe02f11d67e4fe9f3c4f452442d2e9f778 (patch) | |
| tree | 3ed5e5b78b00cf25892a3a18e118eee41cbc15ec /src/extension/internal | |
| parent | Fix typo (diff) | |
| download | inkscape-61cbbcbe02f11d67e4fe9f3c4f452442d2e9f778.tar.gz inkscape-61cbbcbe02f11d67e4fe9f3c4f452442d2e9f778.zip | |
Start migrating 0.92 patch to master
Diffstat (limited to 'src/extension/internal')
| -rw-r--r-- | src/extension/internal/bitmap/imagemagick.cpp | 10 | ||||
| -rw-r--r-- | src/extension/internal/bluredge.cpp | 13 | ||||
| -rw-r--r-- | src/extension/internal/filter/filter.cpp | 13 | ||||
| -rw-r--r-- | src/extension/internal/grid.cpp | 12 |
4 files changed, 44 insertions, 4 deletions
diff --git a/src/extension/internal/bitmap/imagemagick.cpp b/src/extension/internal/bitmap/imagemagick.cpp index 636b9d6a4..32d6f59e3 100644 --- a/src/extension/internal/bitmap/imagemagick.cpp +++ b/src/extension/internal/bitmap/imagemagick.cpp @@ -64,6 +64,16 @@ ImageMagickDocCache::ImageMagickDocCache(Inkscape::UI::View::View * view) : _imageItems(NULL) { SPDesktop *desktop = (SPDesktop*)view; + Inkscape::Selection * selection = NULL; + if (desktop) { + selection = desktop->getSelection(); + if (selection && !selection->params.empty()) { + selection->restoreBackup(); + if (!desktop->on_live_extension) { + selection->emptyBackup(); + } + } + } auto selectedItemList = desktop->selection->items(); int selectCount = (int) boost::distance(selectedItemList); diff --git a/src/extension/internal/bluredge.cpp b/src/extension/internal/bluredge.cpp index f04007d00..c086405e5 100644 --- a/src/extension/internal/bluredge.cpp +++ b/src/extension/internal/bluredge.cpp @@ -53,7 +53,7 @@ BlurEdge::load (Inkscape::Extension::Extension */*module*/) void BlurEdge::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *desktop, Inkscape::Extension::Implementation::ImplementationDocumentCache * /*docCache*/) { - Inkscape::Selection * selection = static_cast<SPDesktop *>(desktop)->selection; + float width = module->get_param_float("blur-width"); int steps = module->get_param_int("num-steps"); @@ -61,6 +61,17 @@ BlurEdge::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View Inkscape::Preferences *prefs = Inkscape::Preferences::get(); double old_offset = prefs->getDouble("/options/defaultoffsetwidth/value", 1.0, "px"); + SPDesktop *deskt = static_cast<SPDesktop *>(desktop); + Inkscape::Selection * selection = NULL; + if (deskt) { + selection = deskt->selection; + if (selection && !selection->params.empty()) { + selection->restoreBackup(); + if (!deskt->on_live_extension) { + selection->emptyBackup(); + } + } + } // TODO need to properly refcount the items, at least std::vector<SPItem*> items(selection->items().begin(), selection->items().end()); selection->clear(); diff --git a/src/extension/internal/filter/filter.cpp b/src/extension/internal/filter/filter.cpp index 166e5406f..af4997eba 100644 --- a/src/extension/internal/filter/filter.cpp +++ b/src/extension/internal/filter/filter.cpp @@ -122,8 +122,17 @@ void Filter::effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::Vie } //printf("Calling filter effect\n"); - Inkscape::Selection * selection = ((SPDesktop *)document)->selection; - + SPDesktop *desktop = (SPDesktop *)document; + Inkscape::Selection * selection = NULL; + if (desktop) { + selection = desktop->selection; + if (selection && !selection->params.empty()) { + selection->restoreBackup(); + if (!desktop->on_live_extension) { + selection->emptyBackup(); + } + } + } // TODO need to properly refcount the items, at least std::vector<SPItem*> items(selection->items().begin(), selection->items().end()); diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp index c7ebf2494..6b3f2efe3 100644 --- a/src/extension/internal/grid.cpp +++ b/src/extension/internal/grid.cpp @@ -86,7 +86,17 @@ Glib::ustring build_lines(Geom::Rect bounding_area, void Grid::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *document, Inkscape::Extension::Implementation::ImplementationDocumentCache * /*docCache*/) { - Inkscape::Selection * selection = ((SPDesktop *)document)->selection; + SPDesktop *desktop = ((SPDesktop *)document); + Inkscape::Selection * selection = NULL; + if (desktop) { + selection = desktop->getSelection(); + if (selection && !selection->params.empty()) { + selection->restoreBackup(); + if (!desktop->on_live_extension) { + selection->emptyBackup(); + } + } + } Geom::Rect bounding_area = Geom::Rect(Geom::Point(0,0), Geom::Point(100,100)); if (selection->isEmpty()) { |
