diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-04-13 12:27:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-04-13 12:30:43 +0300 |
commit | 890e533c7695927212a6164c0ca86ff7a314bf5f (patch) | |
tree | 911dfafe24573f685935eb30b5451c0c97d107a9 /source/blender/blenkernel | |
parent | 176ed5bfe280ef2151f93c0940d54498aaf00d71 (diff) |
Fix adding to paint-curves from the first point
- add_index now works when selecting the first point.
- sliding now selects the correct handle.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_paint.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 4d713449b17..53c2a82fb8e 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -120,6 +120,7 @@ void BKE_paint_brush_set(struct Paint *paint, struct Brush *br); struct Palette *BKE_paint_palette(struct Paint *paint); void BKE_paint_palette_set(struct Paint *p, struct Palette *palette); void BKE_paint_curve_set(struct Brush *br, struct PaintCurve *pc); +void BKE_paint_curve_clamp_endpoint_add_index(struct PaintCurve *pc, const int add_index); void BKE_paint_data_warning(struct ReportList *reports, bool uvs, bool mat, bool tex, bool stencil); bool BKE_paint_proj_mesh_data_check(struct Scene *scene, struct Object *ob, bool *uvs, bool *mat, bool *tex, bool *stencil); diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index a5b608703d1..b45e6b81ec8 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -313,6 +313,11 @@ void BKE_paint_curve_set(Brush *br, PaintCurve *pc) } } +void BKE_paint_curve_clamp_endpoint_add_index(PaintCurve *pc, const int add_index) +{ + pc->add_index = (add_index || pc->tot_points == 1) ? (add_index + 1) : 0; +} + /* remove colour from palette. Must be certain color is inside the palette! */ void BKE_palette_color_remove(Palette *palette, PaletteColor *color) { |