Compare commits

..

2 Commits

Author SHA1 Message Date
karlis dc7a793d3a Merge branch 'main' of http://101.34.228.45:3000/BigC/ArchitectureColoredPainting 2023-03-14 15:03:03 +08:00
karlis 684c28dafd bug fix 2023-03-14 15:02:49 +08:00
1 changed files with 1 additions and 3 deletions

View File

@ -87,13 +87,11 @@ void PreviewWindow::mouseMoveEvent(QMouseEvent* event)
currentLayer->property.offset.setX(currentLayer->property.offset.x() + dx);
currentLayer->property.offset.setY(currentLayer->property.offset.y() + dy);
qDebug() << dx << "----" << dy;
emit layerInfoChanged();
}
else if (event->buttons() & Qt::RightButton) {
// 如果按下的是右键,那么旋转图形
qreal angle = -sqrt(dx * dx + dy * dy) / 1.0;
currentLayer->property.rotation += angle;
emit layerInfoChanged();
}
}
// 更新上一次的位置
@ -103,5 +101,5 @@ void PreviewWindow::mouseMoveEvent(QMouseEvent* event)
void PreviewWindow::mouseReleaseEvent(QMouseEvent* event)
{
// 当鼠标释放时,不做任何操作
emit layerInfoChanged();
}