X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;ds=sidebyside;f=cinelerra-5.1%2Fcinelerra%2Fedit.C;h=f716bb42727f7e1c463b622ddb768a74fc50cb6a;hb=0df48ad2d876409c5beeae2e21933a728ea76c33;hp=bd82f45130cbe9f1fb88bdb74cac39ffb162a7a8;hpb=5c8da1404ee2707ea621e9361541bdc973bcfbb9;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/edit.C b/cinelerra-5.1/cinelerra/edit.C index bd82f451..f716bb42 100644 --- a/cinelerra-5.1/cinelerra/edit.C +++ b/cinelerra-5.1/cinelerra/edit.C @@ -443,6 +443,7 @@ int Edit::shift_start(int edit_mode, int64_t newposition, int64_t oldposition, int edit_labels, int edit_autos, int edit_plugins, Edits *trim_edits) { int64_t cut_length = newposition - oldposition; + int rest_moved = edit_mode == MOVE_RIPPLE || edit_mode == MOVE_EDGE ? 1 : 0; if( cut_length > length ) cut_length = length; else if( cut_length < -length ) @@ -450,11 +451,11 @@ int Edit::shift_start(int edit_mode, int64_t newposition, int64_t oldposition, int64_t start = startproject, end = start + length; Edit *prev = this->previous, *next = this->next; - int edits_moved = 0, rest_moved = 0; + int edits_moved = 0; switch( edit_mode ) { case MOVE_RIPPLE: - edits_moved = rest_moved = 1; + edits_moved = 1; startsource += cut_length; cut_length = -cut_length; length += cut_length; @@ -488,7 +489,7 @@ int Edit::shift_start(int edit_mode, int64_t newposition, int64_t oldposition, } break; case MOVE_EDGE: - edits_moved = rest_moved = 1; + edits_moved = 1; startsource -= cut_length; length += cut_length; for( Edit *edit=next; edit; edit=edit->next ) @@ -504,18 +505,19 @@ int Edit::shift_end(int edit_mode, int64_t newposition, int64_t oldposition, int edit_labels, int edit_autos, int edit_plugins, Edits *trim_edits) { int64_t cut_length = newposition - oldposition; - if( cut_length > length ) - cut_length = length; + int rest_moved = edit_mode == MOVE_RIPPLE || edit_mode == MOVE_EDGE ? 1 : 0; + if( cut_length > length ) { + if( !rest_moved ) cut_length = length; + } else if( cut_length < -length ) cut_length = -length; int64_t start = startproject, end = start + length; Edit *prev = this->previous, *next = this->next; - int edits_moved = 0, rest_moved = 0; + int edits_moved = 0; switch( edit_mode ) { case MOVE_RIPPLE: case MOVE_EDGE: - rest_moved = 1; length += cut_length; for( Edit *edit=next; edit; edit=edit->next ) edit->startproject += cut_length; @@ -651,7 +653,7 @@ int Edit::select_handle(float view_start, float zoom_units, int cursor_x, int cu int64_t pixel1, pixel2; pixel1 = left; - pixel2 = pixel1 + 10; + pixel2 = pixel1 + xS(10); // test left edit // cursor_x is faked in acanvas @@ -663,7 +665,7 @@ int Edit::select_handle(float view_start, float zoom_units, int cursor_x, int cu //int64_t endproject = startproject + length; pixel2 = right; - pixel1 = pixel2 - 10; + pixel1 = pixel2 - xS(10); // test right edit if(cursor_x >= pixel1 && cursor_x <= pixel2)