Commit 338ef953 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix tests

parent 687dea16
...@@ -2884,8 +2884,8 @@ int TimelineModel::requestItemResize(int itemId, int size, bool right, bool logU ...@@ -2884,8 +2884,8 @@ int TimelineModel::requestItemResize(int itemId, int size, bool right, bool logU
int offset = getItemPlaytime(itemId); int offset = getItemPlaytime(itemId);
int tid = getItemTrackId(itemId); int tid = getItemTrackId(itemId);
int out = offset; int out = offset;
if (tid != -1) { if (tid != -1 || isComposition(itemId)) {
in = getItemPosition(itemId); in = qMax(0, getItemPosition(itemId));
out += in; out += in;
size = requestItemResizeInfo(itemId, in, out, size, right, snapDistance); size = requestItemResizeInfo(itemId, in, out, size, right, snapDistance);
} }
...@@ -3085,11 +3085,10 @@ int TimelineModel::requestItemResize(int itemId, int size, bool right, bool logU ...@@ -3085,11 +3085,10 @@ int TimelineModel::requestItemResize(int itemId, int size, bool right, bool logU
continue; continue;
} }
if (right) { if (right) {
finalSize = finalPos - getItemPosition(id); finalSize = finalPos - qMax(0, getItemPosition(id));
} else { } else {
finalSize = getItemPosition(id) + getItemPlaytime(id) - finalPos; finalSize = qMax(0, getItemPosition(id)) + getItemPlaytime(id) - finalPos;
} }
result = result && requestItemResize(id, finalSize, right, logUndo, undo, redo); result = result && requestItemResize(id, finalSize, right, logUndo, undo, redo);
resizedCount++; resizedCount++;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment