Place a piece according to margins values.
This commit is contained in:
parent
a9e5ea55cf
commit
c32a4f60b0
|
@ -209,11 +209,17 @@ void VPCarrouselPieceList::contextMenuEvent(QContextMenuEvent *event)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedAction == moveAction)
|
if (selectedAction == moveAction)
|
||||||
|
{
|
||||||
|
VPSheetPtr sheet = layout->GetFocusedSheet();
|
||||||
|
if (not sheet.isNull())
|
||||||
{
|
{
|
||||||
piece->ClearTransformations();
|
piece->ClearTransformations();
|
||||||
|
QRectF rect = sheet->GetMarginsRect();
|
||||||
|
piece->SetPosition(QPointF(rect.topLeft().x() + 1, rect.topLeft().y() + 1));
|
||||||
auto *command = new VPUndoMovePieceOnSheet(layout->GetFocusedSheet(), piece);
|
auto *command = new VPUndoMovePieceOnSheet(layout->GetFocusedSheet(), piece);
|
||||||
layout->UndoStack()->push(command);
|
layout->UndoStack()->push(command);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (selectedAction == deleteAction)
|
else if (selectedAction == deleteAction)
|
||||||
{
|
{
|
||||||
auto *command = new VPUndoMovePieceOnSheet(layout->GetTrashSheet(), piece);
|
auto *command = new VPUndoMovePieceOnSheet(layout->GetTrashSheet(), piece);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user