Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLMC
Commits
4a1e8941
Commit
4a1e8941
authored
Jan 16, 2010
by
Ludovic Fauvet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Timeline: Move a method to the base class.
parent
ab8c0dfe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
19 deletions
+21
-19
src/Gui/timeline/AbstractGraphicsMediaItem.cpp
src/Gui/timeline/AbstractGraphicsMediaItem.cpp
+15
-0
src/Gui/timeline/AbstractGraphicsMediaItem.h
src/Gui/timeline/AbstractGraphicsMediaItem.h
+6
-0
src/Gui/timeline/GraphicsMovieItem.cpp
src/Gui/timeline/GraphicsMovieItem.cpp
+0
-14
src/Gui/timeline/GraphicsMovieItem.h
src/Gui/timeline/GraphicsMovieItem.h
+0
-5
No files found.
src/Gui/timeline/AbstractGraphicsMediaItem.cpp
View file @
4a1e8941
...
...
@@ -146,3 +146,18 @@ void AbstractGraphicsMediaItem::adjustLength()
Q_ASSERT
(
clip
()
);
resize
(
clip
()
->
getLength
()
);
}
bool
AbstractGraphicsMediaItem
::
resizeZone
(
const
QPointF
&
position
)
{
// Get the current transformation of the view and invert it.
QTransform
transform
=
tracksView
()
->
transform
().
inverted
();
// Map the RESIZE_ZONE distance from the view to the item coordinates.
QLine
line
=
transform
.
map
(
QLine
(
0
,
0
,
RESIZE_ZONE
,
0
)
);
if
(
position
.
x
()
<
line
.
x2
()
||
position
.
x
()
>
(
boundingRect
().
width
()
-
line
.
x2
()
)
)
{
return
true
;
}
return
false
;
}
src/Gui/timeline/AbstractGraphicsMediaItem.h
View file @
4a1e8941
...
...
@@ -128,6 +128,12 @@ protected slots:
*/
void
adjustLength
();
/**
* \brief Check if the position given as parameter could be taken as a resize request.
* \return Returns True if the point is in a resize zone.
*/
bool
resizeZone
(
const
QPointF
&
position
);
private:
/// This pointer will be set when inserted in the tracksView.
TracksView
*
m_tracksView
;
...
...
src/Gui/timeline/GraphicsMovieItem.cpp
View file @
4a1e8941
...
...
@@ -224,17 +224,3 @@ void GraphicsMovieItem::mouseReleaseEvent( QGraphicsSceneMouseEvent* event )
setCursor
(
Qt
::
OpenHandCursor
);
}
bool
GraphicsMovieItem
::
resizeZone
(
const
QPointF
&
position
)
{
// Get the current transformation of the view and invert it.
QTransform
transform
=
tracksView
()
->
transform
().
inverted
();
// Map the RESIZE_ZONE distance from the view to the item coordinates.
QLine
line
=
transform
.
map
(
QLine
(
0
,
0
,
RESIZE_ZONE
,
0
)
);
if
(
position
.
x
()
<
line
.
x2
()
||
position
.
x
()
>
(
boundingRect
().
width
()
-
line
.
x2
()
)
)
{
return
true
;
}
return
false
;
}
src/Gui/timeline/GraphicsMovieItem.h
View file @
4a1e8941
...
...
@@ -75,11 +75,6 @@ protected:
virtual
void
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
private:
/**
* \brief Check if the position given as parameter could be taken as a resize request.
* \return Returns True if the point is in a resize zone.
*/
bool
resizeZone
(
const
QPointF
&
position
);
Clip
*
m_clip
;
signals:
...
...
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