This commit is contained in:
ArsenArsen 2017-06-27 13:58:09 +02:00
parent 67c8f5c5cf
commit 66aec11e0c

View File

@ -233,10 +233,10 @@ void CropScene::updateMag(QPointF scenePos) {
magnifierHint->setPlainText(QString("ptr: (%0, %1)\nsel: %2").arg(scenePos.x()).arg(scenePos.y()).arg(rectStr)); magnifierHint->setPlainText(QString("ptr: (%0, %1)\nsel: %2").arg(scenePos.x()).arg(scenePos.y()).arg(rectStr));
magnifierHintBox->setRect(magnifierHint->boundingRect()); magnifierHintBox->setRect(magnifierHint->boundingRect());
QPointF magnifierTopLeft = scenePos - QPointF(5.5, 5.5);
QPointF magnifierPos = scenePos + QPointF(11, 11);
int pixCnt = settings::settings().value("magnifierPixelCount", 11).toInt(); int pixCnt = settings::settings().value("magnifierPixelCount", 11).toInt();
if (pixCnt % 2 == 0) pixCnt++; if (pixCnt % 2 == 0) pixCnt++;
QPointF magnifierTopLeft = scenePos - QPointF(pixCnt / 2., pixCnt / 2.);
QPointF magnifierPos = scenePos + QPointF(5, 5);
magnifier->setPos(magnifierPos); magnifier->setPos(magnifierPos);
magnifier->setPixmap(_pixmap->copy(magnifierTopLeft.x(), magnifierTopLeft.y(), pixCnt, pixCnt).scaled(110, 110)); magnifier->setPixmap(_pixmap->copy(magnifierTopLeft.x(), magnifierTopLeft.y(), pixCnt, pixCnt).scaled(110, 110));