Skip to content

Commit

Permalink
optimize wave underline width
Browse files Browse the repository at this point in the history
  • Loading branch information
royqh1979 committed Mar 3, 2024
1 parent 8561a03 commit 43658bc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libs/qsynedit/qsynedit/painter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,8 @@ void QSynEditPainter::paintEditAreas(const EditingAreaList &areaList)
setDrawingColors(false);
for (const PEditingArea& p:areaList) {
int penWidth = std::max(1,mEdit->font().pixelSize() / 15);
if (p->type == EditingAreaType::eatWaveUnderLine)
penWidth = std::max(1,mEdit->font().pixelSize() / 21);
if (p->beginX > mRight)
continue;
if (p->endX < mLeft)
Expand All @@ -488,6 +490,8 @@ void QSynEditPainter::paintEditAreas(const EditingAreaList &areaList)
mPainter->setBrush(Qt::NoBrush);
switch(p->type) {
case EditingAreaType::eatRectangleBorder:
rc.setTop(rc.top()+penWidth/2);
rc.setBottom(rc.bottom()-penWidth/2);
mPainter->drawRect(rc);
break;
case EditingAreaType::eatUnderLine: {
Expand Down

0 comments on commit 43658bc

Please sign in to comment.