Selected piece on top
This commit is contained in:
parent
9f8f0e8341
commit
a0cd4e9a31
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user