Changeset View
Standalone View
source/blender/editors/space_sequencer/sequencer_select.c
| Context not available. | |||||
| switch (left_right) { | switch (left_right) { | ||||
| case SEQ_SELECT_LR_MOUSE: | case SEQ_SELECT_LR_MOUSE: | ||||
| x = UI_view2d_region_to_view_x(v2d, mval[0]); | x = UI_view2d_region_to_view_x(v2d, mval[0]); | ||||
| if ((x >= (CFRA - 5.0f)) && (x <= (CFRA + 5.0f))) { | |||||
| x = CFRA; | |||||
| } | |||||
ISS: What is this supposed to do? And why? | |||||
tintwotinAuthorUnsubmitted Done Inline ActionsIn the original function ctrl+left mouse to the left or right of playhead will select "Left" or "Right". What is added here is ctrl+left mouse close to playhead will select "Center". tintwotin: In the original function ctrl+left mouse to the left or right of playhead will select "Left" or… | |||||
ISSUnsubmitted Done Inline ActionsI guess that would be OK. It looks like it should do that, but if I just looked at code without any context, I would have no clue. So please add some comment that this is some kind of dead zone to allow 3 modes be done with mouse. My main issue then is with implementation:
make variable float under_playhead_margin = UI_view2d_view_to_region_x(v2d, 5.0f) and use that instead of 5.0f value ISS: I guess that would be OK. It looks like it should do that, but if I just looked at code without… | |||||
ISSUnsubmitted Done Inline ActionsOops float under_playhead_margin = UI_view2d_view_to_region_x(v2d, 5.0f) was wrong, but I have fixed it. ISS: Oops `float under_playhead_margin = UI_view2d_view_to_region_x(v2d, 5.0f)` was wrong, but I… | |||||
| break; | break; | ||||
| case SEQ_SELECT_LR_LEFT: | case SEQ_SELECT_LR_LEFT: | ||||
| x = CFRA - 1.0f; | x = CFRA - 1.0f; | ||||
| break; | break; | ||||
| case SEQ_SELECT_LR_RIGHT: | case SEQ_SELECT_LR_RIGHT: | ||||
| x = CFRA + 1.0f; | |||||
| break; | |||||
| case SEQ_SELECT_LR_CENTER: | |||||
| default: | default: | ||||
| x = CFRA; | x = CFRA; | ||||
| break; | break; | ||||
| } | } | ||||
| SEQP_BEGIN (ed, seq) { | SEQP_BEGIN (ed, seq) { | ||||
| if (((x < CFRA) && (seq->enddisp <= CFRA)) || ((x >= CFRA) && (seq->startdisp >= CFRA))) { | if (((x == CFRA) && (seq->startdisp <= CFRA) && (seq->enddisp >= CFRA))) { | ||||
| seq->flag = SELECT; | |||||
| recurs_sel_seq(seq); | |||||
| } | |||||
| else if (((x < CFRA) && (seq->enddisp <= CFRA)) || ((x > CFRA) && (seq->startdisp >= CFRA))) { | |||||
| seq->flag |= SELECT; | seq->flag |= SELECT; | ||||
| recurs_sel_seq(seq); | recurs_sel_seq(seq); | ||||
| } | } | ||||
ISSUnsubmitted Done Inline ActionsI would rather have 3 functions here and comments what particular branch does and if it is linked to any option. Separate function with descriptive names would be better perhaps but given this function is already undocumented and in quite bad shape, just comment is OK. ISS: I would rather have 3 functions here and comments what particular branch does and if it is… | |||||
| Context not available. | |||||
| {SEQ_SELECT_LR_MOUSE, "MOUSE", 0, "Mouse", "Use mouse position for selection"}, | {SEQ_SELECT_LR_MOUSE, "MOUSE", 0, "Mouse", "Use mouse position for selection"}, | ||||
| {SEQ_SELECT_LR_LEFT, "LEFT", 0, "Left", "Select left"}, | {SEQ_SELECT_LR_LEFT, "LEFT", 0, "Left", "Select left"}, | ||||
| {SEQ_SELECT_LR_RIGHT, "RIGHT", 0, "Right", "Select right"}, | {SEQ_SELECT_LR_RIGHT, "RIGHT", 0, "Right", "Select right"}, | ||||
| {SEQ_SELECT_LR_CENTER, "CENTER", 0, "Center", "Select center"}, | |||||
ISSUnsubmitted Done Inline ActionsOption "center" doesn't really make sense. I guess something like "intersecting" or "under playhead" would be better. ISS: Option "center" doesn't really make sense. I guess something like "intersecting" or "under… | |||||
tintwotinAuthorUnsubmitted Done Inline ActionsSince the menu is called Playhead > Left/Right, I guess "Under" would be enough? tintwotin: Since the menu is called Playhead > Left/Right, I guess "Under" would be enough? | |||||
ISSUnsubmitted Done Inline ActionsI think it's enough for UI, though it would be better if it was called explicitly under playhead when used in code - it's more readable. Even description for those 3 options could be updated to Select left to playhead, Select right to playhead and Select under playhead After all these operators could exist outside of menu providing context (custom addon) where it is nicer to hover on top of button to see what it actually does. ISS: I think it's enough for UI, though it would be better if it was called explicitly under… | |||||
| {0, NULL, 0, NULL, NULL}, | {0, NULL, 0, NULL, NULL}, | ||||
| }; | }; | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| Context not available. | |||||
What is this supposed to do? And why?