X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fonmonitoritems%2Fonmonitorrectitem.cpp;h=fc1b822da8f1c25d4117f97ae93991ba60963cc4;hb=3c844989ad9fdb96bb9258a990a9874773b3d792;hp=44e6f4217e1ce3347bdea5d12061d595f6728226;hpb=a12cf2d6e75a7a9857330a6109b36d5b99a2ccb4;p=kdenlive diff --git a/src/onmonitoritems/onmonitorrectitem.cpp b/src/onmonitoritems/onmonitorrectitem.cpp index 44e6f421..fc1b822d 100644 --- a/src/onmonitoritems/onmonitorrectitem.cpp +++ b/src/onmonitoritems/onmonitorrectitem.cpp @@ -27,11 +27,11 @@ #include OnMonitorRectItem::OnMonitorRectItem(const QRectF &rect, double dar, QGraphicsItem* parent) : - QGraphicsRectItem(rect, parent) - , m_dar(dar) - , m_mode(NoAction) - , m_modified(false) - , m_view(NULL) + QGraphicsRectItem(rect, parent) + , m_dar(dar) + , m_mode(NoAction) + , m_modified(false) + , m_view(NULL) { setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable); @@ -61,7 +61,7 @@ rectActions OnMonitorRectItem::getMode(const QPointF &pos) qreal ysize = 12; if (getView()) { xsize /= m_view->matrix().m11(); - ysize /= m_view->matrix().m22(); + ysize /= m_view->matrix().m22(); } mouseArea.addRect(pos.x() - xsize / 2, pos.y() - ysize / 2, xsize, ysize); @@ -176,7 +176,7 @@ void OnMonitorRectItem::mouseMoveEvent(QGraphicsSceneMouseEvent* event) // Keep aspect ratio if (event->modifiers() == Qt::ControlModifier) { - // compare to rect during mouse press: + // compare to rect during mouse press: // if we subtract rect() we'll get a whole lot of flickering // because of diffWidth > diffHeight changing all the time int diffWidth = qAbs(r.width() - m_oldRect.width()); @@ -263,6 +263,7 @@ void OnMonitorRectItem::hoverMoveEvent(QGraphicsSceneHoverEvent* event) void OnMonitorRectItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) { Q_UNUSED(widget) + Q_UNUSED(option) painter->setPen(pen()); //painter->setClipRect(option->rect); @@ -270,13 +271,13 @@ void OnMonitorRectItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* painter->drawRect(r); QRectF handle = painter->worldTransform().inverted().mapRect(QRectF(0, 0, 6, 6)); if (isEnabled()) { - handle.moveTopLeft(r.topLeft()); + handle.moveTopLeft(r.topLeft()); painter->fillRect(handle, QColor(Qt::yellow)); - handle.moveTopRight(r.topRight()); + handle.moveTopRight(r.topRight()); painter->fillRect(handle, QColor(Qt::yellow)); - handle.moveBottomLeft(r.bottomLeft()); + handle.moveBottomLeft(r.bottomLeft()); painter->fillRect(handle, QColor(Qt::yellow)); - handle.moveBottomRight(r.bottomRight()); + handle.moveBottomRight(r.bottomRight()); painter->fillRect(handle, QColor(Qt::yellow)); }