Commit 759fe210 authored by Anatoly Mihalchenko's avatar Anatoly Mihalchenko

SANKORE-599

When it rotates with the tool bracket gestures to change its size are not consistent. The parameters of size change does not take into account the position of the bracket.
SANKORE-598
Changing the size of the bracket using the angles opposite the right angle does not work all the time, we must rotate the bracket so you can change its size
parent 666a3d73
......@@ -54,6 +54,7 @@
#include "tools/UBGraphicsCompass.h"
#include "tools/UBGraphicsCache.h"
#include "tools/UBGraphicsTriangle.h"
#include "core/memcheck.h"
......@@ -430,6 +431,7 @@ UBBoardView::mousePressEvent (QMouseEvent *event)
|| movingItem->type() == UBGraphicsCompass::Type
|| movingItem->type() == UBGraphicsPDFItem::Type
|| movingItem->type() == UBGraphicsPolygonItem::Type
|| movingItem->type() == UBGraphicsTriangle::Type
|| movingItem->type() == UBGraphicsCache::Type
|| scene()->isBackgroundObject(movingItem))
{
......
......@@ -586,7 +586,7 @@ QCursor UBGraphicsTriangle::flipCursor() const
void UBGraphicsTriangle::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
lastRect = rect().toRect();
lastPos = event->screenPos();
lastPos = transform().inverted().map(event->screenPos());
if (resize1Polygon().containsPoint(event->pos().toPoint(), Qt::OddEvenFill))
{
......@@ -620,18 +620,13 @@ void UBGraphicsTriangle::mousePressEvent(QGraphicsSceneMouseEvent *event)
void UBGraphicsTriangle::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
QPoint currPos = event->screenPos();
// qDebug() << QString(" X: %1 ").arg(currPos.x());
// qDebug() << QString(" Y: %1 ").arg(currPos.y());
if (!mResizing1 && !mResizing2 && !mRotating)
{
QGraphicsItem::mouseMoveEvent(event);
}
else
{
//-----------------------------------------------//
QPoint currPos = transform().inverted().map(event->screenPos());
if (mResizing1)
{
......
......@@ -131,6 +131,8 @@ class UBGraphicsTriangle : public UBAbstractDrawRuler, public QGraphicsPolygonIt
bool mResizing2;
bool mRotating;
QRect lastRect;
// Coordinates are transformed....
QPoint lastPos;
QGraphicsSvgItem* mHFlipSvgItem;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment