Sketcher: fix cropping of some icons on hidpi screens
This commit is contained in:
committed by
Kacper Donat
parent
8e774e4309
commit
b39e097fea
@@ -1338,7 +1338,7 @@ private:
|
||||
QSizeF(iconWidth, iconWidth));
|
||||
QPainter cursorPainter;
|
||||
cursorPainter.begin(&cursorPixmap);
|
||||
cursorPainter.drawPixmap(16 * pixelRatio, 16 * pixelRatio, icon);
|
||||
cursorPainter.drawPixmap(16, 16, icon);
|
||||
cursorPainter.end();
|
||||
int hotX = 8;
|
||||
int hotY = 8;
|
||||
@@ -1626,7 +1626,7 @@ public:
|
||||
QPixmap icon = Gui::BitmapFactory().pixmapFromSvg("Constraint_Dimension", QSizeF(iconWidth, iconWidth));
|
||||
QPainter cursorPainter;
|
||||
cursorPainter.begin(&cursorPixmap);
|
||||
cursorPainter.drawPixmap(16 * pixelRatio, 16 * pixelRatio, icon);
|
||||
cursorPainter.drawPixmap(16, 16, icon);
|
||||
cursorPainter.end();
|
||||
int hotX = 8;
|
||||
int hotY = 8;
|
||||
|
||||
@@ -2756,6 +2756,8 @@ QImage EditModeConstraintCoinManager::renderConstrIcon(const QString& type,
|
||||
pxMap); // Cache for speed, avoiding pixmapFromSvg
|
||||
}
|
||||
QImage icon = pxMap.toImage();
|
||||
// The pixmap was already scaled so we don't need to scale the image
|
||||
icon.setDevicePixelRatio(1.0f);
|
||||
|
||||
QFont font = ViewProviderSketchCoinAttorney::getApplicationFont(viewProvider);
|
||||
font.setPixelSize(static_cast<int>(1.0 * drawingParameters.constraintIconSize));
|
||||
|
||||
Reference in New Issue
Block a user