minor refactor
This commit is contained in:
parent
d648e741df
commit
b3b5affeb8
|
@ -1255,10 +1255,10 @@ void QSynEditPainter::paintLines()
|
|||
}
|
||||
areaList.append(area);
|
||||
|
||||
mEdit->mGlyphPostionListCache.str = sLine;
|
||||
mEdit->mGlyphPostionListCache.glyphCharList = glyphStartCharList;
|
||||
mEdit->mGlyphPostionListCache.glyphPositionList = glyphStartPositionsList;
|
||||
mEdit->mGlyphPostionListCache.strWidth = tokenLeft;
|
||||
mEdit->mGlyphPostionCacheForInputMethod.str = sLine;
|
||||
mEdit->mGlyphPostionCacheForInputMethod.glyphCharList = glyphStartCharList;
|
||||
mEdit->mGlyphPostionCacheForInputMethod.glyphPositionList = glyphStartPositionsList;
|
||||
mEdit->mGlyphPostionCacheForInputMethod.strWidth = tokenLeft;
|
||||
}
|
||||
paintEditAreas(areaList);
|
||||
}
|
||||
|
|
|
@ -2503,9 +2503,9 @@ QRect QSynEdit::calculateCaretRect() const
|
|||
QString sLine = lineText().left(mCaretX-1)
|
||||
+ mInputPreeditString
|
||||
+ lineText().mid(mCaretX-1);
|
||||
if (sLine == mGlyphPostionListCache.str) {
|
||||
int glyphIdx = searchForSegmentIdx(mGlyphPostionListCache.glyphCharList,0,sLine.length(),mCaretX+mInputPreeditString.length()-1);
|
||||
coord.x = segmentIntervalStart(mGlyphPostionListCache.glyphPositionList,0,mGlyphPostionListCache.strWidth, glyphIdx);
|
||||
if (sLine == mGlyphPostionCacheForInputMethod.str) {
|
||||
int glyphIdx = searchForSegmentIdx(mGlyphPostionCacheForInputMethod.glyphCharList,0,sLine.length(),mCaretX+mInputPreeditString.length()-1);
|
||||
coord.x = segmentIntervalStart(mGlyphPostionCacheForInputMethod.glyphPositionList,0,mGlyphPostionCacheForInputMethod.strWidth, glyphIdx);
|
||||
} else
|
||||
coord.x = charToGlyphLeft(mCaretY, sLine, mCaretX+mInputPreeditString.length());
|
||||
}
|
||||
|
|
|
@ -779,7 +779,7 @@ private:
|
|||
int mWheelAccumulatedDeltaY;
|
||||
|
||||
PFormatter mFormatter;
|
||||
GlyphPostionsListCache mGlyphPostionListCache;
|
||||
GlyphPostionsListCache mGlyphPostionCacheForInputMethod;
|
||||
|
||||
friend class QSynEditPainter;
|
||||
|
||||
|
|
Loading…
Reference in New Issue