feat: basic image flip support

This commit is contained in:
Gary Wang
2021-03-19 23:11:06 +08:00
parent deed477d49
commit 6a9e5e80d0
6 changed files with 25 additions and 0 deletions

View File

@ -134,6 +134,17 @@ void GraphicsView::zoomView(qreal scaleFactor)
emit navigatorViewRequired(!isThingSmallerThanWindowWith(transform()), m_rotateAngle);
}
void GraphicsView::flipView(bool horizontal)
{
if (horizontal) {
scale(-1, 1);
} else {
scale(1, -1);
}
// I guess we don't need to check if we need to trigger navigator view here
// since fliping doesn't affact the image rectangle size.
}
void GraphicsView::resetScale()
{
resetWithScaleAndRotate(1, m_rotateAngle);