remove some code setting pixel density ratio for pixmaps

update
This commit is contained in:
captain0xff
2025-04-03 01:49:16 +05:30
parent 740a028df5
commit 887cbd0e1a
8 changed files with 16 additions and 37 deletions

View File

@@ -120,7 +120,7 @@ void ToolHandler::setSvgCursor(const QString& cursorName,
//
qreal pRatio = devicePixelRatio();
bool isRatioOne = (pRatio == 1.0);
qreal defaultCursorSize = isRatioOne ? 64 : 32;
qreal cursorSize = isRatioOne ? 64 : 32;
qreal hotX = x;
qreal hotY = y;
#if !defined(Q_OS_WIN32) && !defined(Q_OS_MACOS)
@@ -129,15 +129,13 @@ void ToolHandler::setSvgCursor(const QString& cursorName,
hotY *= pRatio;
}
#endif
qreal cursorSize = defaultCursorSize * pRatio;
QPixmap pointer = Gui::BitmapFactory().pixmapFromSvg(cursorName.toStdString().c_str(),
QSizeF(cursorSize, cursorSize),
QSizeF{cursorSize, cursorSize},
colorMapping);
if (isRatioOne) {
pointer = pointer.scaled(32, 32);
}
pointer.setDevicePixelRatio(pRatio);
setCursor(pointer, hotX, hotY, false);
}