Commit 3bad66a8 authored by Jan Hambrecht's avatar Jan Hambrecht
Browse files

extended KoShapeManager::shapeAt to optionally not return hidden shapes and improved documentation


svn path=/trunk/koffice/; revision=568337
parent f306f6cb
......@@ -151,16 +151,19 @@ void KoShapeManager::paint( QPainter &painter, const KoViewConverter &converter,
m_selection->paint( painter, converter );
}
KoShape * KoShapeManager::shapeAt( const QPointF &position )
KoShape * KoShapeManager::shapeAt( const QPointF &position, bool omitHiddenShapes )
{
updateTree();
QList<KoShape*> sorterdShapes( m_tree.contains( position ) );
qSort(sorterdShapes.begin(), sorterdShapes.end(), KoShape::compareShapeZIndex);
for(int count = sorterdShapes.count()-1; count >= 0; count--) {
if ( sorterdShapes.at(count)->hitTest( position ) )
KoShape *shape = sorterdShapes.at(count);
if( omitHiddenShapes && ! shape->isVisible() )
continue;
if ( shape->hitTest( position ) )
{
//kDebug() << "Hittest succeeded" << endl;
return sorterdShapes.at(count);
return shape;
}
}
if ( m_selection->hitTest( position ) )
......
......@@ -93,9 +93,12 @@ public:
/**
* Returns the shape located at a specific point in the document.
* If more than one shape is located at the specific point, the one with
* the highest z-index is returned.
* @param position the position in the document coordinate system.
* @param omitHiddenShape if true, only visible shapes are considered
*/
KoShape * shapeAt( const QPointF &position );
KoShape * shapeAt( const QPointF &position, bool omitHiddenShapes = false );
/**
* Returns the shapes which intersects the specific rect in the document.
......
* add a ShearingStrategy (boemann)
* Add 'ensureVisible(KoShape)' to KoCanvasController (see QScrollArea for what it should do)
* extend KoShapeManager shapesAt
- optionally not return hidden shapes (KoShape::visible())
* extend KoShapeManager shapeAt to
- optionally not return hidden shapes (KoShape::visible())
- return a shape out of the shapes at point based on its selection.
......
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