diff options
Diffstat (limited to 'source/blender/freestyle')
-rw-r--r-- | source/blender/freestyle/FRS_freestyle.h | 3 | ||||
-rw-r--r-- | source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp | 22 |
2 files changed, 7 insertions, 18 deletions
diff --git a/source/blender/freestyle/FRS_freestyle.h b/source/blender/freestyle/FRS_freestyle.h index 039a75a2f0f..a6382010ca7 100644 --- a/source/blender/freestyle/FRS_freestyle.h +++ b/source/blender/freestyle/FRS_freestyle.h @@ -63,8 +63,7 @@ void FRS_exit(void); void FRS_copy_active_lineset(struct FreestyleConfig *config); void FRS_paste_active_lineset(struct FreestyleConfig *config); void FRS_delete_active_lineset(struct FreestyleConfig *config); -void FRS_move_active_lineset_up(struct FreestyleConfig *config); -void FRS_move_active_lineset_down(struct FreestyleConfig *config); +bool FRS_move_active_lineset(struct FreestyleConfig *config, int direction); /* Testing */ struct Material *FRS_create_stroke_material(struct Main *bmain, struct FreestyleLineStyle *linestyle); diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp index 4d8c6a66d42..2af4447e4dc 100644 --- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp +++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp @@ -730,24 +730,14 @@ void FRS_delete_active_lineset(FreestyleConfig *config) } } -void FRS_move_active_lineset_up(FreestyleConfig *config) -{ - FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config); - - if (lineset) { - BLI_remlink(&config->linesets, lineset); - BLI_insertlinkbefore(&config->linesets, lineset->prev, lineset); - } -} - -void FRS_move_active_lineset_down(FreestyleConfig *config) +/** + * Reinsert the active lineset at an offset \a direction from current position. + * \return if position of active lineset has changed. + */ +bool FRS_move_active_lineset(FreestyleConfig *config, int direction) { FreestyleLineSet *lineset = BKE_freestyle_lineset_get_active(config); - - if (lineset) { - BLI_remlink(&config->linesets, lineset); - BLI_insertlinkafter(&config->linesets, lineset->next, lineset); - } + return (lineset != NULL) && BLI_listbase_link_move(&config->linesets, lineset, direction); } // Testing |