[vlmc-devel] Clip.qml: Simplify the calculation of new begin and end on resizing
Yikai Lu
git at videolan.org
Fri Aug 12 16:52:31 CEST 2016
vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Mon Aug 8 19:18:00 2016 -0500| [16fcdab0291ff769d60ffd77fdef2524326d0444] | committer: Yikai Lu
Clip.qml: Simplify the calculation of new begin and end on resizing
> https://code.videolan.org/videolan/vlmc/commit/16fcdab0291ff769d60ffd77fdef2524326d0444
---
src/Gui/timeline/Clip.qml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/Gui/timeline/Clip.qml b/src/Gui/timeline/Clip.qml
index f217b07..a773bf9 100644
--- a/src/Gui/timeline/Clip.qml
+++ b/src/Gui/timeline/Clip.qml
@@ -244,15 +244,15 @@ Rectangle {
// Handle resizing
if ( resizing === true ) {
if ( mouseX < width / 2 ) {
- var newPos = ptof( clip.x + mouseX );
- var newBegin = begin + ( newPos - position );
+ var newPos = position + ptof( mouseX );
+ var newBegin = begin + ptof( mouseX );
if ( newBegin < 0 || newPos < 0 || newBegin >= end )
return;
begin = newBegin;
position = newPos;
}
else {
- var newEnd = ptof( mouseX + ftop( begin ) );
+ var newEnd = begin + ptof( mouseX );
if ( newEnd <= begin || newEnd + 1 > clipInfo["length"] )
return;
end = newEnd;
More information about the Vlmc-devel
mailing list