Code

Filters. New custom predefined cross-smooth filter (very experimental...).
[inkscape.git] / src / tweak-context.cpp
index 68e62b9755b2f13ff4fad60afc13f85f226dcb72..29289e053adbb5ce3eabc63719f61e98e6a47ee1 100644 (file)
@@ -55,7 +55,6 @@
 #include "path-chemistry.h"
 #include "sp-gradient.h"
 #include "sp-stop.h"
-#include "sp-stop-fns.h"
 #include "sp-gradient-reference.h"
 #include "sp-linear-gradient.h"
 #include "sp-radial-gradient.h"
@@ -208,23 +207,27 @@ sp_tweak_update_cursor (SPTweakContext *tc, bool with_shift)
    switch (tc->mode) {
        case TWEAK_MODE_MOVE:
            tc->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag to <b>move</b>."), sel_message);
-                           break;
            event_context->cursor_shape = cursor_tweak_move_xpm;
            break;
        case TWEAK_MODE_MOVE_IN_OUT:
            tc->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag or click to <b>move in</b>; with Shift to <b>move out</b>."), sel_message);
+           event_context->cursor_shape = cursor_tweak_move_xpm;
            break;
        case TWEAK_MODE_MOVE_JITTER:
            tc->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag or click to <b>move randomly</b>."), sel_message);
+           event_context->cursor_shape = cursor_tweak_move_xpm;
            break;
        case TWEAK_MODE_SCALE:
            tc->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag or click to <b>scale down</b>; with Shift to <b>scale up</b>."), sel_message);
+           event_context->cursor_shape = cursor_tweak_move_xpm;
            break;
        case TWEAK_MODE_ROTATE:
            tc->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag or click to <b>rotate clockwise</b>; with Shift, <b>counterclockwise</b>."), sel_message);
+           event_context->cursor_shape = cursor_tweak_move_xpm;
            break;
        case TWEAK_MODE_MORELESS:
            tc->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag or click to <b>duplicate</b>; with Shift, <b>delete</b>."), sel_message);
+           event_context->cursor_shape = cursor_tweak_move_xpm;
            break;
        case TWEAK_MODE_PUSH:
            tc->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag to <b>push paths</b>."), sel_message);
@@ -252,6 +255,7 @@ sp_tweak_update_cursor (SPTweakContext *tc, bool with_shift)
            break;
        case TWEAK_MODE_COLORPAINT:
            tc->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag or click to <b>paint objects</b> with color."), sel_message);
+           event_context->cursor_shape = cursor_color_xpm;
            break;
        case TWEAK_MODE_COLORJITTER:
            tc->_message_context->setF(Inkscape::NORMAL_MESSAGE, _("%s. Drag or click to <b>randomize colors</b>."), sel_message);
@@ -833,20 +837,24 @@ tweak_colors_in_gradient (SPItem *item, bool fill_or_stroke,
 
     // Normalize pos to 0..1, taking into accound gradient spread:
     double pos_e = pos;
-    if (gradient->spread == SP_GRADIENT_SPREAD_PAD) {
-        if (pos > 1)
+    if (gradient->getSpread() == SP_GRADIENT_SPREAD_PAD) {
+        if (pos > 1) {
             pos_e = 1;
-        if (pos < 0)
+        }
+        if (pos < 0) {
             pos_e = 0;
-    } else if (gradient->spread == SP_GRADIENT_SPREAD_REPEAT) {
-        if (pos > 1 || pos < 0)
+        }
+    } else if (gradient->getSpread() == SP_GRADIENT_SPREAD_REPEAT) {
+        if (pos > 1 || pos < 0) {
             pos_e = pos - floor(pos);
-    } else if (gradient->spread == SP_GRADIENT_SPREAD_REFLECT) {
+        }
+    } else if (gradient->getSpread() == SP_GRADIENT_SPREAD_REFLECT) {
         if (pos > 1 || pos < 0) {
             bool odd = ((int)(floor(pos)) % 2 == 1);
             pos_e = pos - floor(pos);
-            if (odd)
+            if (odd) {
                 pos_e = 1 - pos_e;
+            }
         }
     }
 
@@ -1531,4 +1539,4 @@ sp_tweak_context_root_handler(SPEventContext *event_context,
   fill-column:99
   End:
 */
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :