Sketcher: [skip ci] fix computing of hotspot of XPM icons on Windows/macOS

Add a cross to copy and array icons.
This commit is contained in:
wmayer
2020-09-27 12:06:26 +02:00
parent b3ca8f2284
commit e2d0bf2c3a
2 changed files with 30 additions and 23 deletions

View File

@@ -1112,16 +1112,19 @@ static const char *cursor_createcopy[]={
"# c red",
". c None",
"................................",
".......+........................",
".......+........................",
".......+........................",
".......+........................",
".......+........................",
"................................",
".+++++...+++++..................",
"................................",
"................................",
"................................",
"................................",
"................................",
"......................###.......",
"......................###.......",
"......................###.......",
"......................###.......",
".......+........................",
".......+..............###.......",
".......+..............###.......",
".......+..............###.......",
".......+..............###.......",
"......................###.......",
".....###..............###.......",
".....###..............###.......",
@@ -1139,9 +1142,6 @@ static const char *cursor_createcopy[]={
"................................",
"................................",
"................................",
"................................",
"................................",
"................................",
"................................"};
class DrawSketchHandlerCopy: public DrawSketchHandler
@@ -1629,16 +1629,19 @@ static const char *cursor_createrectangulararray[]={
"# c red",
". c None",
"................................",
".......+........................",
".......+........................",
".......+........................",
".......+........................",
".......+........................",
"................................",
"................................",
"................................",
"................................",
".+++++...+++++..................",
".......................###......",
".......................###......",
".......................###......",
".......................###......",
"..............###......###......",
"..............###......###......",
".......+...............###......",
".......+...............###......",
".......+...............###......",
".......+......###......###......",
".......+......###......###......",
"..............###......###......",
"..............###......###......",
".....###......###......###......",
@@ -1656,9 +1659,6 @@ static const char *cursor_createrectangulararray[]={
".....###........................",
".....###........................",
"................................",
"................................",
"................................",
"................................",
"................................"};
class DrawSketchHandlerRectangularArray: public DrawSketchHandler

View File

@@ -155,7 +155,14 @@ void DrawSketchHandler::setCursor(const QPixmap &p,int x,int y, bool autoScale)
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
p1.setDevicePixelRatio(pRatio);
#endif
cursor = QCursor(p1, x * pRatio, y * pRatio);
#if defined(Q_OS_WIN32) || defined(Q_OS_MAC)
qreal hotX = x;
qreal hotY = y;
#else
qreal hotX = x * pRatio;
qreal hotY = y * pRatio;
#endif
cursor = QCursor(p1, hotX, hotY);
} else {
// already scaled
cursor = QCursor(p1, x, y);