Fix T47366: Single slope linear curve was wrongly using vector handle
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 9 Feb 2016 13:51:32 +0000 (14:51 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 9 Feb 2016 13:51:32 +0000 (14:51 +0100)
Vector handle is only required for a symmetric curve to give nice a /\ shape.
Single slope curves better to use AUTO handle by default.

source/blender/blenkernel/intern/colortools.c

index 3fb9ff1c9e82e376af4ed77364b57530018fe91a..df45761fbe1013657dbaa82f033222c4329c620a 100644 (file)
@@ -293,10 +293,12 @@ void curvemap_reset(CurveMap *cuma, const rctf *clipr, int preset, int slope)
                case CURVE_PRESET_LINE:
                        cuma->curve[0].x = clipr->xmin;
                        cuma->curve[0].y = clipr->ymax;
-                       cuma->curve[0].flag |= CUMA_VECTOR;
                        cuma->curve[1].x = clipr->xmax;
                        cuma->curve[1].y = clipr->ymin;
-                       cuma->curve[1].flag |= CUMA_VECTOR;
+                       if (slope == CURVEMAP_SLOPE_POS_NEG) {
+                               cuma->curve[0].flag |= CUMA_VECTOR;
+                               cuma->curve[1].flag |= CUMA_VECTOR;
+                       }
                        break;
                case CURVE_PRESET_SHARP:
                        cuma->curve[0].x = 0;