Commit b3808fb6 authored by Matan Ziv-Av's avatar Matan Ziv-Av
Browse files

Some small fixes

- Change Brahmic ranges according to !764 (comment 558117)
- Use symbolic bitmap values,instead of a magic number.
- Fix a crash with wordModeAttr enabled and bidi disabled
parent efc1e66b
Pipeline #263829 passed with stage
in 5 minutes and 31 seconds
......@@ -1250,8 +1250,9 @@ notcombine:
currentChar.flags |= EF_ASCII_WORD;
}
if (c >= 0x900
&& (c <= 0x109f || (c >= 0x1700 && c <= 0x18af) || (c >= 0x1900 && c <= 0x1aaf) || (c >= 0xa800 && c <= 0xa82f) || (c >= 0xa840 && c <= 0xa95f)
|| (c >= 0xa980 && c <= 0xaaff) || (c >= 0xabc0 && c <= 0xabff) || (c >= 0x10a00 && c <= 0x10a5f) || (c >= 0x11000 && c <= 0x11fff))) {
&& (c <= 0x109f || (c >= 0x1700 && c <= 0x18af) || (c >= 0x1900 && c <= 0x1aaf) || (c >= 0x1b00 && c <= 0x1c4f) || (c >= 0xa800 && c <= 0xa82f)
|| (c >= 0xa840 && c <= 0xa95f) || (c >= 0xa980 && c <= 0xaaff) || (c >= 0xabc0 && c <= 0xabff) || (c >= 0x10a00 && c <= 0x10a5f)
|| (c >= 0x11000 && c <= 0x11fff))) {
currentChar.flags |= EF_BRAHMIC_WORD;
}
......
......@@ -109,6 +109,10 @@ const RenditionFlags RE_UNDERLINE_BIT = (1 << 12);
const RenditionFlags RE_MASK_UNDER = RE_TRANSPARENT | RE_REVERSE | RE_CURSOR | RE_SELECTED;
const RenditionFlags RE_MASK_ABOVE = RE_TRANSPARENT | RE_REVERSE | RE_CURSOR | RE_SELECTED | RE_STRIKEOUT | RE_CONCEAL | RE_OVERLINE | RE_UNDERLINE_MASK;
// flags that affect how the text is drawn
// without RE_REVERSE, since the foreground color is calculated
const RenditionFlags RE_TEXTDRAWING = RE_BOLD | RE_BLINK | RE_TRANSPARENT | RE_ITALIC | RE_CURSOR | RE_FAINT | RE_SELECTED;
const ExtraFlags EF_UNREAL = 0;
const ExtraFlags EF_REAL = (1 << 0);
......@@ -386,7 +390,7 @@ public:
inline bool notSameAttributesText(Character lhs) const
{
// Only compare attributes used for drawing text
return (lhs.rendition.all & 0x8b5) != (rendition.all & 0x8b5) || lhs.textColor() != textColor();
return (lhs.rendition.all & RE_TEXTDRAWING) != (rendition.all & RE_TEXTDRAWING) || lhs.textColor() != textColor();
}
inline bool isRightHalfOfDoubleWide() const
......
......@@ -260,7 +260,8 @@ void TerminalPainter::drawContents(Character *image,
charType = 2;
}
if (lastCharType != charType
|| (wordModeAttr && lastCharType != 0 && char_value.notSameAttributesText(image[pos + line2log[vis2line[x - 1]]]))) {
|| (wordModeAttr && lastCharType != 0
&& char_value.notSameAttributesText(image[pos + (bidiEnabled ? line2log[vis2line[x - 1]] : x - 1)]))) {
if (lastCharType != 0) {
drawTextCharacters(paint,
QRect(textScale.inverted().map(QPoint(word_x, textY)), QSize(textWidth, textHeight)),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment