diff --git a/libs/flake/KoInteractionTool.cpp b/libs/flake/KoInteractionTool.cpp index 0f70373d8312cf9805fcadf3a9297e9d9c5f4a00..c1f6771aa76c5669642d7f2165c1af163bb68545 100644 --- a/libs/flake/KoInteractionTool.cpp +++ b/libs/flake/KoInteractionTool.cpp @@ -84,7 +84,7 @@ void KoInteractionTool::paint( QPainter &painter, KoViewConverter &converter) { painter.setPen( pen ); bool editable=false; foreach(KoShape *shape, selection()->selectedObjects(KoFlake::StrippedSelection)) { - painter.drawRect( converter.normalToView(shape->boundingBox()) ); + painter.drawRect( converter.normalToView(shape->boundingRect()) ); if(!shape->isLocked()) editable = true; } @@ -92,7 +92,7 @@ void KoInteractionTool::paint( QPainter &painter, KoViewConverter &converter) { if( !editable) return; - SelectionDecorator decorator(selection()->boundingBox(), m_lastHandle, true, true); + SelectionDecorator decorator(selection()->boundingRect(), m_lastHandle, true, true); decorator.paint(painter, converter); } } @@ -125,7 +125,7 @@ void KoInteractionTool::mouseMoveEvent( KoGfxEvent *event ) { } QRectF KoInteractionTool::handlesSize() { - QRectF bound = selection()->boundingBox(); + QRectF bound = selection()->boundingRect(); // expansion Border QPointF border = m_canvas->viewConverter()->viewToNormal(QPointF(HANDLE_DISTANCE, HANDLE_DISTANCE)); bound.adjust(-border.x(), -border.y(), border.x(), border.y()); @@ -207,7 +207,7 @@ KoFlake::SelectionHandle KoInteractionTool::handleAt(const QPointF &point, bool } void KoInteractionTool::recalcSelectionBox() { - QRectF bb( selection()->boundingBox() ); + QRectF bb( selection()->boundingRect() ); float width = bb.width(); float height = bb.height(); float halfWidth = width / 2.0; diff --git a/libs/flake/KoPathShape.cpp b/libs/flake/KoPathShape.cpp index 97a1652fb80016282e781cd2941de005beb498a4..e3009ef35404177830bc11ce6c92705a19b0d2ed 100644 --- a/libs/flake/KoPathShape.cpp +++ b/libs/flake/KoPathShape.cpp @@ -86,7 +86,7 @@ bool KoPathShape::hitTest( const QPointF &position ) const return m_path.contains( point ); } -QRectF KoPathShape::boundingBox() const +QRectF KoPathShape::boundingRect() const { QRectF bb( m_path.boundingRect() ); bb.moveTopLeft( position() ); diff --git a/libs/flake/KoPathShape.h b/libs/flake/KoPathShape.h index d436b102a6766fc4ca978f4ca6cec9a7fec437ec..6ffd94a5357064dca265d35ce1ba0b46bf983a1d 100644 --- a/libs/flake/KoPathShape.h +++ b/libs/flake/KoPathShape.h @@ -43,7 +43,7 @@ public: void close(); bool hitTest( const QPointF &position ) const; - virtual QRectF boundingBox() const; + virtual QRectF boundingRect() const; virtual const QPainterPath outline() const; private: diff --git a/libs/flake/KoSelection.cpp b/libs/flake/KoSelection.cpp index a5c1b6f4c33f7cadccaad40517ddd8c80ff6039c..88f67bda2b49b81f2f444e3662587a61233aa4aa 100644 --- a/libs/flake/KoSelection.cpp +++ b/libs/flake/KoSelection.cpp @@ -42,7 +42,7 @@ void KoSelection::paint( QPainter &painter, KoViewConverter &converter) if ( count() == 0 ) return; painter.setRenderHint( QPainter::Antialiasing, false ); - QRectF bb = converter.normalToView( boundingBox() ); + QRectF bb = converter.normalToView( boundingRect() ); QPen pen( Qt::blue ); //TODO make it configurable painter.setPen( pen ); painter.drawRect( bb ); @@ -97,7 +97,7 @@ void KoSelection::requestSelectionChangedEvent() { void KoSelection::selectionChangedEvent() { m_eventTriggered = false; - QRectF bb( boundingBox() ); + QRectF bb( boundingRect() ); resize( bb.size() ); setPosition( bb.topLeft() ); emit selectionChanged(); @@ -112,7 +112,7 @@ bool KoSelection::hitTest( const QPointF &position ) const { if ( count() > 1 ) { - QRectF bb( boundingBox() ); + QRectF bb( boundingRect() ); return bb.contains( position ); } else if ( count() == 1 ) @@ -121,7 +121,7 @@ bool KoSelection::hitTest( const QPointF &position ) const return false; } -QRectF KoSelection::boundingBox() const +QRectF KoSelection::boundingRect() const { bool first=true; QRectF bb; @@ -132,11 +132,11 @@ QRectF KoSelection::boundingBox() const if( dynamic_cast( *it )) continue; if(first) { - bb = (*it)->boundingBox(); + bb = (*it)->boundingRect(); first = false; } else - bb = bb.unite( ( *it )->boundingBox() ); + bb = bb.unite( ( *it )->boundingRect() ); } } return bb; diff --git a/libs/flake/KoSelection.h b/libs/flake/KoSelection.h index 087d1f6b59891b3d930eebba94e0a877a8a14d52..f4deee7a792bc2e0d36ebf9c77eac209ce3e2405 100644 --- a/libs/flake/KoSelection.h +++ b/libs/flake/KoSelection.h @@ -74,7 +74,7 @@ public: virtual bool hitTest( const QPointF &position ) const; - virtual QRectF boundingBox() const; + virtual QRectF boundingRect() const; signals: /// emitted when the selection is changed diff --git a/libs/flake/KoShape.cpp b/libs/flake/KoShape.cpp index ec880a209cd9bdbc5ad24d063f710bcbb59258d5..c9482474ef2637057365881fd3641f8490e93739 100644 --- a/libs/flake/KoShape.cpp +++ b/libs/flake/KoShape.cpp @@ -131,7 +131,7 @@ bool KoShape::hitTest( const QPointF &position ) const return hit; } -QRectF KoShape::boundingBox() const +QRectF KoShape::boundingRect() const { QRectF bb( QPointF(0, 0), m_size ); return m_matrix.mapRect( bb ); diff --git a/libs/flake/KoShape.h b/libs/flake/KoShape.h index 404eedee8eb2b699d77ae458a5909a7ea7ccb543..b2c3b258b469989f68abca3f0430d3aa7a81b9d6 100644 --- a/libs/flake/KoShape.h +++ b/libs/flake/KoShape.h @@ -180,7 +180,7 @@ public: * * @return the bounding box of the shape */ - virtual QRectF boundingBox() const; + virtual QRectF boundingRect() const; /** * @brief Add a connector point to the shape diff --git a/libs/flake/KoShapeManager.cpp b/libs/flake/KoShapeManager.cpp index d46e0da136e5286a4d7ef80e803a88ac987e6f3b..bf5422315a7a417c9efe307b33b4a1733cf65841 100644 --- a/libs/flake/KoShapeManager.cpp +++ b/libs/flake/KoShapeManager.cpp @@ -85,7 +85,7 @@ void KoShapeManager::paint( QPainter &painter, KoViewConverter &converter, bool if(shape->parent() != 0 && shape->parent()->childClipped(shape)) continue; if(painter.hasClipping()) { - QRectF objectBox = shape->boundingBox(); + QRectF objectBox = shape->boundingRect(); objectBox = converter.normalToView(objectBox); QRegion objectRegion = QRegion(objectBox.toRect()); diff --git a/libs/flake/KoShapeMoveStrategy.cpp b/libs/flake/KoShapeMoveStrategy.cpp index df13cff81db36043a1603eaefb6b67c7a2672793..33f90235309b4c1f049b8f43a3b98ff3f153aa47 100644 --- a/libs/flake/KoShapeMoveStrategy.cpp +++ b/libs/flake/KoShapeMoveStrategy.cpp @@ -38,16 +38,16 @@ KoShapeMoveStrategy::KoShapeMoveStrategy( KoTool *tool, KoCanvasBase *canvas, co , m_start(clicked) { KoSelectionSet selectedObjects = canvas->shapeManager()->selection()->selectedObjects(KoFlake::StrippedSelection); - QRectF boundingBox; + QRectF boundingRect; foreach(KoShape *shape, selectedObjects) { if(shape->isLocked()) continue; m_selectedObjects << shape; m_previousPositions << shape->position(); m_newPositions << shape->position(); - boundingBox = boundingBox.unite( shape->boundingBox() ); + boundingRect = boundingRect.unite( shape->boundingRect() ); } - m_initialTopLeft = boundingBox.topLeft(); + m_initialTopLeft = boundingRect.topLeft(); } void KoShapeMoveStrategy::handleMouseMove(const QPointF &point, Qt::KeyboardModifiers modifiers) { diff --git a/libs/flake/KoShapeResizeStrategy.cpp b/libs/flake/KoShapeResizeStrategy.cpp index 55781c114ecdd62df932c17cb83000d252330522..a8a6cc527c7e9f5b21e951828033cbfbaa56ffc0 100644 --- a/libs/flake/KoShapeResizeStrategy.cpp +++ b/libs/flake/KoShapeResizeStrategy.cpp @@ -35,7 +35,7 @@ KoShapeResizeStrategy::KoShapeResizeStrategy( KoTool *tool, KoCanvasBase *canvas m_selectedObjects << shape; m_startPositions << shape->absolutePosition(); m_startSizes << shape->size(); - m_initialBoundingRect = m_initialBoundingRect.unite( shape->boundingBox() ); + m_initialBoundingRect = m_initialBoundingRect.unite( shape->boundingRect() ); } m_start = clicked; @@ -146,6 +146,6 @@ KCommand* KoShapeResizeStrategy::createCommand() { } void KoShapeResizeStrategy::paint( QPainter &painter, KoViewConverter &converter) { - SelectionDecorator decorator (m_canvas->shapeManager()->selection()->boundingBox(), KoFlake::NoHandle, false, false); + SelectionDecorator decorator (m_canvas->shapeManager()->selection()->boundingRect(), KoFlake::NoHandle, false, false); decorator.paint(painter, converter); } diff --git a/libs/flake/KoShapeRotateStrategy.cpp b/libs/flake/KoShapeRotateStrategy.cpp index 19bb0dfe2ad9384728bc6408c7bd7c218d7c1857..15b1a1709ee384436b33207277ee40cc17419c1e 100644 --- a/libs/flake/KoShapeRotateStrategy.cpp +++ b/libs/flake/KoShapeRotateStrategy.cpp @@ -41,7 +41,7 @@ KoShapeRotateStrategy::KoShapeRotateStrategy( KoTool *tool, KoCanvasBase *canvas m_selectedObjects << shape; m_startPositions << shape->absolutePosition(); m_initialAngles << shape->rotation(); - m_initialBoundingRect = m_initialBoundingRect.unite( shape->boundingBox() ); + m_initialBoundingRect = m_initialBoundingRect.unite( shape->boundingRect() ); } } @@ -76,7 +76,7 @@ void KoShapeRotateStrategy::handleMouseMove(const QPointF &point, Qt::KeyboardMo } void KoShapeRotateStrategy::paint( QPainter &painter, KoViewConverter &converter) { - SelectionDecorator decorator (m_canvas->shapeManager()->selection()->boundingBox(), KoFlake::NoHandle, true, false); + SelectionDecorator decorator (m_canvas->shapeManager()->selection()->boundingRect(), KoFlake::NoHandle, true, false); decorator.paint(painter, converter); } diff --git a/libs/flake/KoShapeRubberSelectStrategy.cpp b/libs/flake/KoShapeRubberSelectStrategy.cpp index 72c0c68585c1b1a86853f05e28a1a21129b61b5c..1ff7f15d6bfb08fa51d9692fc7f4f96f86af2f8d 100644 --- a/libs/flake/KoShapeRubberSelectStrategy.cpp +++ b/libs/flake/KoShapeRubberSelectStrategy.cpp @@ -91,8 +91,8 @@ void KoShapeRubberSelectStrategy::finishInteraction() const QList &objects = m_canvas->shapeManager()->objects(); foreach ( KoShape * object, objects ) { - //qDebug() << "o bb:" << object->boundingBox() << ", m_selectRect:" << m_selectRect; - if ( object->boundingBox().intersects( m_selectRect ) ) + //qDebug() << "o bb:" << object->boundingRect() << ", m_selectRect:" << m_selectRect; + if ( object->boundingRect().intersects( m_selectRect ) ) { selection->select( object ); }