Skip to content

Commit

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

This reverts commit 7377626.
  • Loading branch information
SrNetoChan authored and nyalldawson committed Sep 11, 2019
1 parent 5ca7891 commit cfd164b
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 cfd164b

Please sign in to comment.