Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-03-29 00:58:14 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-03-29 00:58:14 +0400
commit93deb27dd4b4e12f118cd74ca5c70a485c19e81b (patch)
tree27b7c93ecc5c17832ab6717db790b18f9a46f68a /source/blender/editors/animation
parent986bbbfe8ab61daf0bd22e8891b559238dba0806 (diff)
fix [#34804] Only timeline_markers[0] is selectable if multiple markers at same frame
also add macros for looping on listbases as if they were circular lists which is handy for cycling over items.
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r--source/blender/editors/animation/anim_markers.c39
1 files changed, 25 insertions, 14 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index deb018ac74a..b4bbb14245d 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -1017,24 +1017,35 @@ static void MARKER_OT_duplicate(wmOperatorType *ot)
/* ************************** selection ************************************/
/* select/deselect TimeMarker at current frame */
-static void select_timeline_marker_frame(ListBase *markers, int frame, unsigned char shift)
+static void select_timeline_marker_frame(ListBase *markers, int frame, bool extend)
{
- TimeMarker *marker;
- int select = 0;
-
+ TimeMarker *marker, *marker_first = NULL;
+
+ /* support for selection cycling */
for (marker = markers->first; marker; marker = marker->next) {
- /* if Shift is not set, then deselect Markers */
- if (!shift) marker->flag &= ~SELECT;
-
- /* this way a not-shift select will allways give 1 selected marker */
- if ((marker->frame == frame) && (!select)) {
- if (marker->flag & SELECT)
- marker->flag &= ~SELECT;
- else
- marker->flag |= SELECT;
- select = 1;
+ if (marker->frame == frame) {
+ if (marker->flag & SELECT) {
+ marker_first = marker->next;
+ break;
+ }
+ }
+ }
+
+ /* if extend is not set, then deselect markers */
+ if (extend == false) {
+ for (marker = markers->first; marker; marker = marker->next) {
+ marker->flag &= ~SELECT;
+ }
+ }
+
+ LISTBASE_CIRCULAR_FORWARD_BEGIN (markers, marker, marker_first) {
+ /* this way a not-extend select will allways give 1 selected marker */
+ if (marker->frame == frame) {
+ marker->flag ^= SELECT;
+ break;
}
}
+ LISTBASE_CIRCULAR_FORWARD_END (markers, marker, marker_first);
}
static int ed_marker_select(bContext *C, const wmEvent *event, bool extend, bool camera)