Skip to content

Commit

Permalink
Revert "Revise map tip cursor offset calculations to better handle hi…
Browse files Browse the repository at this point in the history
…dpi screens"

This reverts commit 7377626.
  • Loading branch information
SrNetoChan committed Sep 1, 2019
1 parent 5ca7891 commit 80ceac0
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/gui/qgsmaptip.cpp
Expand Up @@ -146,18 +146,8 @@ void QgsMapTip::showMapTip( QgsMapLayer *pLayer,

QgsDebugMsg( tipHtml );

int cursorOffset = 0;
// attempt to shift the tip away from the cursor.
if ( QgsApplication::instance() )
{
// The following calculations are taken
// from QgsApplication::getThemeCursor, and are used to calculate the correct cursor size
// for both hi-dpi and non-hi-dpi screens.
double scale = Qgis::UI_SCALE_FACTOR * QgsApplication::instance()->fontMetrics().height() / 32.0;
cursorOffset = static_cast< int >( std::ceil( scale * 32 ) );
}

mWidget->move( pixelPosition.x() + cursorOffset, pixelPosition.y() );
mWidget->move( pixelPosition.x() + Qgis::UI_SCALE_FACTOR * 15,
pixelPosition.y() );

mWebView->setHtml( tipHtml );
lastTipText = tipText;
Expand Down

0 comments on commit 80ceac0

Please sign in to comment.