|
|
@ -1979,7 +1979,16 @@ void UBGraphicsScene::addMagnifier(UBMagnifierParams params) |
|
|
|
setModified(true); |
|
|
|
setModified(true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBGraphicsScene::moveMagnifier(QPoint newPos) |
|
|
|
void UBGraphicsScene::moveMagnifier() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (magniferControlViewWidget) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
QPoint magnifierPos = QPoint(magniferControlViewWidget->pos().x() + magniferControlViewWidget->size().width() / 2, magniferControlViewWidget->pos().y() + magniferControlViewWidget->size().height() / 2 ); |
|
|
|
|
|
|
|
moveMagnifier(magnifierPos, true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBGraphicsScene::moveMagnifier(QPoint newPos, bool forceGrab) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QWidget *cContainer = (QWidget*)(UBApplication::boardController->controlContainer()); |
|
|
|
QWidget *cContainer = (QWidget*)(UBApplication::boardController->controlContainer()); |
|
|
|
QGraphicsView *cView = (QGraphicsView*)UBApplication::boardController->controlView(); |
|
|
|
QGraphicsView *cView = (QGraphicsView*)UBApplication::boardController->controlView(); |
|
|
@ -1987,6 +1996,8 @@ void UBGraphicsScene::moveMagnifier(QPoint newPos) |
|
|
|
|
|
|
|
|
|
|
|
QPoint dvZeroPoint = dView->mapToGlobal(QPoint(0,0)); |
|
|
|
QPoint dvZeroPoint = dView->mapToGlobal(QPoint(0,0)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QRect qcr = cView->geometry(); |
|
|
|
|
|
|
|
QRect qdr = dView->geometry(); |
|
|
|
int cvW = cView->width(); |
|
|
|
int cvW = cView->width(); |
|
|
|
int dvW = dView->width(); |
|
|
|
int dvW = dView->width(); |
|
|
|
qreal wCoeff = (qreal)dvW / (qreal)cvW; |
|
|
|
qreal wCoeff = (qreal)dvW / (qreal)cvW; |
|
|
@ -1999,8 +2010,8 @@ void UBGraphicsScene::moveMagnifier(QPoint newPos) |
|
|
|
QPoint cvPoint = cView->mapFromGlobal(globalPoint); |
|
|
|
QPoint cvPoint = cView->mapFromGlobal(globalPoint); |
|
|
|
QPoint dvPoint( cvPoint.x() * wCoeff + dvZeroPoint.x(), cvPoint.y() * hCoeff + dvZeroPoint.y()); |
|
|
|
QPoint dvPoint( cvPoint.x() * wCoeff + dvZeroPoint.x(), cvPoint.y() * hCoeff + dvZeroPoint.y()); |
|
|
|
|
|
|
|
|
|
|
|
magniferControlViewWidget->grabNMove(globalPoint, globalPoint, false, false); |
|
|
|
magniferControlViewWidget->grabNMove(globalPoint, globalPoint, forceGrab, false); |
|
|
|
magniferDisplayViewWidget->grabNMove(globalPoint, dvPoint, false, true); |
|
|
|
magniferDisplayViewWidget->grabNMove(globalPoint, dvPoint, forceGrab, true); |
|
|
|
|
|
|
|
|
|
|
|
setModified(true); |
|
|
|
setModified(true); |
|
|
|
} |
|
|
|
} |
|
|
|