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:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user