minor change

This commit is contained in:
Roy Qu 2022-10-21 09:07:32 +08:00
parent 98f4766ffd
commit 8e771bd322
2 changed files with 7 additions and 7 deletions

View File

@ -1609,7 +1609,7 @@ void Editor::onStatusChanged(QSynedit::StatusChanges changes)
// Is there a bracket char before us?
int lineLength = lineText().length();
int ch = caretX() - 2;
QSynedit::BufferCoord coord;
QSynedit::BufferCoord coord{0,0};
if (ch>=0 && ch<lineLength && isBraceChar(lineText()[ch]) ) {
coord.ch = ch+1;
coord.line = caretY();

View File

@ -6129,16 +6129,16 @@ void SynEdit::resizeEvent(QResizeEvent *)
{
//resize the cache image
qreal dpr = devicePixelRatioF();
std::shared_ptr<QImage> image = std::make_shared<QImage>(clientWidth()*dpr,clientHeight()*dpr,
mContentImage = std::make_shared<QImage>(clientWidth()*dpr,clientHeight()*dpr,
QImage::Format_ARGB32);
image->setDevicePixelRatio(dpr);
QRect newRect = image->rect().intersected(mContentImage->rect());
mContentImage->setDevicePixelRatio(dpr);
// QRect newRect = image->rect().intersected(mContentImage->rect());
QPainter painter(image.get());
// QPainter painter(image.get());
painter.drawImage(newRect,*mContentImage);
//painter.drawImage(newRect,*mContentImage);
mContentImage = image;
// mContentImage = image;
onSizeOrFontChanged(false);
}