diff --git a/src/app/puzzle/vpmaingraphicsview.cpp b/src/app/puzzle/vpmaingraphicsview.cpp index d7241a72c..4c4c3d1a0 100644 --- a/src/app/puzzle/vpmaingraphicsview.cpp +++ b/src/app/puzzle/vpmaingraphicsview.cpp @@ -232,9 +232,22 @@ void VPMainGraphicsView::on_PieceMovedToPieceList(VPPiece *piece, VPPieceList *p //--------------------------------------------------------------------------------------------------------------------- void VPMainGraphicsView::on_SceneSelectionChanged() { - // most of the selection behaviour taks place automatically + // most of the selection behaviour takes place automatically // but we need to make sure that the unplaced pieces are unselected when the scene selection has changed // because as they are not part of the scene, they are not updated - m_layout->GetUnplacedPieceList()->ClearSelection(); + + + // make sure, that the selected items are on top + // FIXME: maybe there is a more proper way to do it + for(auto graphicPiece : m_graphicsPieces) + { + if(!graphicPiece->GetPiece()->GetIsSelected()) + { + if(!m_scene->selectedItems().isEmpty()) + { + graphicPiece->stackBefore(m_scene->selectedItems().first()); + } + } + } } diff --git a/src/app/puzzle/vptilefactory.cpp b/src/app/puzzle/vptilefactory.cpp index a7606b1b4..1f3cd73c6 100644 --- a/src/app/puzzle/vptilefactory.cpp +++ b/src/app/puzzle/vptilefactory.cpp @@ -71,6 +71,7 @@ void VPTileFactory::drawTile(QPainter *painter, VPMainGraphicsView *graphicsView QSvgRenderer* svgRenderer = new QSvgRenderer(); + // FIXME here instead of creating 4 triangle, maybe create one and rotate it // ------------- prepare triangles for positioning @@ -263,10 +264,10 @@ void VPTileFactory::drawTile(QPainter *painter, VPMainGraphicsView *graphicsView // prepare the painting for the text information QTextDocument td; - -// td.documentLayout()->setPaintDevice(printer); ?? - - td.setPageSize(QSizeF(m_drawingAreaWidth - UnitConvertor(2, Unit::Cm, Unit::Px), m_drawingAreaHeight)); + td.setPageSize(QSizeF( + m_drawingAreaWidth - UnitConvertor(2, Unit::Cm, Unit::Px), + m_drawingAreaHeight + )); // paint the grid information const QString grid = tr("Grid ( %1 , %2 )").arg(row+1).arg(col+1);