Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

small effect keyframe fix

svn path=/branches/KDE4/; revision=2265
parent f04ed524
......@@ -18,12 +18,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
#include <KDebug>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QScrollBar>
#include <QToolTip>
#include <KDebug>
#include <KLocale>
#include "abstractclipitem.h"
AbstractClipItem::AbstractClipItem(const ItemInfo info, const QRectF& rect, double fps): QGraphicsRectItem(rect), m_track(0), m_fps(fps), m_editedKeyframe(-1), m_selectedKeyframe(0), m_keyframeFactor(1) {
......@@ -269,7 +271,7 @@ int AbstractClipItem::mouseOverKeyFrames(QPointF pos) {
x1 = br.x() + maxw * (i.key() - m_cropStart.frames(m_fps));
y1 = br.bottom() - i.value() * maxh;
if (qAbs(pos.x() - x1) < 6 && qAbs(pos.y() - y1) < 6) {
setToolTip("[" + QString::number(i.key()) + " frames, " + QString::number(i.value(), 'f', 1) + "%]");
setToolTip("[" + QString::number((GenTime(i.key(), m_fps) - m_cropStart).seconds(), 'f', 2) + i18n("seconds") + ", " + QString::number(i.value(), 'f', 1) + "%]");
return i.key();
} else if (x1 > pos.x()) break;
++i;
......
......@@ -547,12 +547,12 @@ void CustomTrackView::mouseDoubleClickEvent(QMouseEvent *event) {
QDialog d(parentWidget());
Ui::KeyFrameDialog_UI view;
view.setupUi(&d);
view.kfr_position->setText(m_document->timecode().getTimecode(GenTime(m_dragItem->selectedKeyFramePos(), m_document->fps()), m_document->fps()));
view.kfr_position->setText(m_document->timecode().getTimecode(GenTime(m_dragItem->selectedKeyFramePos(), m_document->fps()) - m_dragItem->cropStart(), m_document->fps()));
view.kfr_value->setValue(m_dragItem->selectedKeyFrameValue());
view.kfr_value->setFocus();
if (d.exec() == QDialog::Accepted) {
int pos = m_document->timecode().getFrameCount(view.kfr_position->text(), m_document->fps());
m_dragItem->updateKeyFramePos(GenTime(pos, m_document->fps()), (double) view.kfr_value->value() * m_dragItem->keyFrameFactor());
m_dragItem->updateKeyFramePos(GenTime(pos, m_document->fps()) + m_dragItem->cropStart(), (double) view.kfr_value->value() * m_dragItem->keyFrameFactor());
ClipItem *item = (ClipItem *)m_dragItem;
item->updateKeyframeEffect();
updateEffect(m_tracksList.count() - item->track(), item->startPos(), item->selectedEffect());
......
Markdown is supported
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