Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLMC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
luyikei
VLMC
Commits
ebb5a5b0
Commit
ebb5a5b0
authored
Jun 25, 2009
by
Hugo Beauzee-Luyssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed crash when moving media.
parent
3a75a92c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/gui/TracksView.cpp
src/gui/TracksView.cpp
+5
-4
No files found.
src/gui/TracksView.cpp
View file @
ebb5a5b0
...
...
@@ -165,7 +165,6 @@ void TracksView::moveMediaItem( AbstractGraphicsMediaItem* item, QPoint position
QPointF
oldPos
=
item
->
pos
();
QGraphicsItem
*
oldParent
=
item
->
parentItem
();
// Check for vertical collisions
item
->
setParentItem
(
m_layout
->
itemAt
(
track
)
->
graphicsItem
()
);
bool
continueSearch
=
true
;
...
...
@@ -182,13 +181,14 @@ void TracksView::moveMediaItem( AbstractGraphicsMediaItem* item, QPoint position
itemCollision
=
true
;
if
(
currentItem
->
pos
().
y
()
<
position
.
y
()
)
{
if
(
track
<
0
)
if
(
track
<
1
)
{
item
->
setParentItem
(
oldParent
);
continueSearch
=
false
;
break
;
}
track
-=
1
;
Q_ASSERT
(
m_layout
->
itemAt
(
track
)
->
graphicsItem
()
!=
NULL
);
item
->
setParentItem
(
m_layout
->
itemAt
(
track
)
->
graphicsItem
()
);
}
else
if
(
currentItem
->
pos
().
y
()
>
position
.
y
()
)
...
...
@@ -200,6 +200,7 @@ void TracksView::moveMediaItem( AbstractGraphicsMediaItem* item, QPoint position
break
;
}
track
+=
1
;
Q_ASSERT
(
m_layout
->
itemAt
(
track
)
->
graphicsItem
()
!=
NULL
);
item
->
setParentItem
(
m_layout
->
itemAt
(
track
)
->
graphicsItem
()
);
}
}
...
...
@@ -207,7 +208,6 @@ void TracksView::moveMediaItem( AbstractGraphicsMediaItem* item, QPoint position
if
(
!
itemCollision
)
continueSearch
=
false
;
}
// Check for horizontal collisions
mappedXPos
=
qMax
(
mappedXPos
,
(
qreal
)
0
);
item
->
setPos
(
mappedXPos
,
0
);
...
...
@@ -219,7 +219,8 @@ void TracksView::moveMediaItem( AbstractGraphicsMediaItem* item, QPoint position
{
// Collision with an item of the same type
// Restoring original position (horizontal)
item
->
setPos
(
oldPos
);
if
(
oldPos
.
isNull
()
==
false
)
item
->
setPos
(
oldPos
);
break
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment