Skip to content

Commit 337cc70

Browse files
committedJan 5, 2018
Normalize cursor size
1 parent 333347b commit 337cc70

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎src/core/qgsapplication.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -542,17 +542,17 @@ QCursor QgsApplication::getThemeCursor( const Cursor &cursor )
542542
Q_ASSERT( ! name.isEmpty( ) );
543543

544544
QIcon icon = getThemeIcon( QStringLiteral( "cursors" ) + QDir::separator() + name );
545-
QCursor _cursor;
545+
QCursor cursorIcon;
546546
// Check if an icon exists for this cursor (the O.S. default cursor will be used if it does not)
547547
if ( ! icon.isNull( ) )
548548
{
549549
// Apply scaling
550-
float scale( ( float ) app->fontMetrics().height() / 32 * 1.5 ) ; // Make them bigger to match 24x24
551-
_cursor = QCursor( icon.pixmap( std::ceil( scale * 32 ), std::ceil( scale * 32 ) ), std::ceil( scale * activeX ), std::ceil( scale * activeY ) );
550+
float scale = app->fontMetrics().height() / 32.0;
551+
cursorIcon = QCursor( icon.pixmap( std::ceil( scale * 32 ), std::ceil( scale * 32 ) ), std::ceil( scale * activeX ), std::ceil( scale * activeY ) );
552552
}
553553
if ( app )
554-
app->mCursorCache.insert( cursor, _cursor );
555-
return _cursor;
554+
app->mCursorCache.insert( cursor, cursorIcon );
555+
return cursorIcon;
556556
}
557557

558558
// TODO: add some caching mechanism ?

0 commit comments

Comments
 (0)
Please sign in to comment.