Compare commits
2 Commits
72f0f78e64
...
dc7a793d3a
Author | SHA1 | Date |
---|---|---|
karlis | dc7a793d3a | |
karlis | 684c28dafd |
|
@ -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();
|
||||
}
|
Loading…
Reference in New Issue