diff --git a/NEWS.md b/NEWS.md index 9060f9f0..4fcbbefe 100644 --- a/NEWS.md +++ b/NEWS.md @@ -34,6 +34,7 @@ Red Panda C++ Version 1.0.0 - fix: if there is a Red Panda C++ process running program, other Red Panda C++ processes can't run program correctly. - enhancement: ctrl+enter insert a new line at the end of current line - enhancement: create file in files view + - fix: hits in the search view not correctly displayed (overlapped with others) Red Panda C++ Version 0.14.5 - fix: the "gnu c++ 20" option in compiler set options is wrong diff --git a/RedPandaIDE/widgets/searchresultview.cpp b/RedPandaIDE/widgets/searchresultview.cpp index ffb51c7e..ff4a355c 100644 --- a/RedPandaIDE/widgets/searchresultview.cpp +++ b/RedPandaIDE/widgets/searchresultview.cpp @@ -460,6 +460,7 @@ void SearchResultTreeViewDelegate::paint(QPainter *painter, const QStyleOptionVi QFont font = option.font; font.setBold(true); text=item->text.mid(item->start-1,item->len); + metrics = QFontMetrics(font); int width = metrics.horizontalAdvance(text); QFont oldFont = painter->font(); QPen oldPen = painter->pen();