forked from qt-creator/qt-creator
Editor: fix annotation tooltips for horizontally scrolled editors
Fixes: QTCREATORBUG-32658 Change-Id: I6853617e1b564d25bff1ec40735b5f1d0e79f0ae Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -4969,7 +4969,7 @@ bool TextEditorWidget::viewportEvent(QEvent *event)
|
|||||||
// Only handle tool tip for text cursor if mouse is within the block for the text cursor,
|
// Only handle tool tip for text cursor if mouse is within the block for the text cursor,
|
||||||
// and not if the mouse is e.g. in the empty space behind a short line.
|
// and not if the mouse is e.g. in the empty space behind a short line.
|
||||||
if (line.isValid()) {
|
if (line.isValid()) {
|
||||||
const QRectF blockGeometry = blockBoundingGeometry(block);
|
const QRectF blockGeometry = blockBoundingGeometry(block).translated(contentOffset());
|
||||||
const int width = block == d->m_suggestionBlock ? blockGeometry.width()
|
const int width = block == d->m_suggestionBlock ? blockGeometry.width()
|
||||||
: line.naturalTextRect().right();
|
: line.naturalTextRect().right();
|
||||||
if (pos.x() <= blockGeometry.left() + width) {
|
if (pos.x() <= blockGeometry.left() + width) {
|
||||||
|
Reference in New Issue
Block a user