Code

Patch by Adib for 238796
authorscislac <scislac@users.sourceforge.net>
Mon, 21 Sep 2009 20:58:04 +0000 (20:58 +0000)
committerscislac <scislac@users.sourceforge.net>
Mon, 21 Sep 2009 20:58:04 +0000 (20:58 +0000)
src/desktop.cpp
src/desktop.h

index 8c070786e6a5d0e6530ad48426cb0abadd55cee7..f7ef1a8cdb79c6d9a02d6a6aef7be6aaf58c5906 100644 (file)
@@ -148,7 +148,6 @@ SPDesktop::SPDesktop() :
     _layer_hierarchy( 0 ),
     _reconstruction_old_layer_id( 0 ),
     _display_mode(Inkscape::RENDERMODE_NORMAL),
-    _saved_display_mode(Inkscape::RENDERMODE_NORMAL),
     _widget( 0 ),
     _inkscape( 0 ),
     _guides_message_context( 0 ),
@@ -444,18 +443,21 @@ void SPDesktop::_setDisplayMode(Inkscape::RenderMode mode) {
     SP_CANVAS_ARENA (drawing)->arena->rendermode = mode;
     canvas->rendermode = mode;
     _display_mode = mode;
-    if (mode != Inkscape::RENDERMODE_OUTLINE) {
-        _saved_display_mode = _display_mode;
-    }
     sp_canvas_item_affine_absolute (SP_CANVAS_ITEM (main), _d2w); // redraw
     _widget->setTitle(SP_DOCUMENT_NAME(sp_desktop_document(this)));
 }
 
 void SPDesktop::displayModeToggle() {
-    if (_display_mode == Inkscape::RENDERMODE_OUTLINE) {
-        _setDisplayMode(_saved_display_mode);
-    } else {
+    switch (_display_mode) {
+    case Inkscape::RENDERMODE_NORMAL:
+        _setDisplayMode(Inkscape::RENDERMODE_NO_FILTERS);
+        break;
+    case Inkscape::RENDERMODE_NO_FILTERS:
         _setDisplayMode(Inkscape::RENDERMODE_OUTLINE);
+        break;
+    case Inkscape::RENDERMODE_OUTLINE:
+    default:
+        _setDisplayMode(Inkscape::RENDERMODE_NORMAL);
     }
 }
 
index 73b9262ddd01d6dfcd93aadc7c8c06d3030e11ab..4438c90e56afc830fc600aca1cfbec2a9b173baf 100644 (file)
@@ -203,7 +203,6 @@ struct SPDesktop : public Inkscape::UI::View::View
     }
     void displayModeToggle();
     Inkscape::RenderMode _display_mode;
-    Inkscape::RenderMode _saved_display_mode;
     Inkscape::RenderMode getMode() const { return _display_mode; }
 
     Inkscape::UI::Widget::Dock* getDock() { return _widget->getDock(); }