Commit dd7cd6b8 authored by Tomaz  Canabrava's avatar Tomaz Canabrava
Browse files

Group character related isSameAttributes method

parent 33b546b9
......@@ -206,6 +206,11 @@ public:
const bool lineDraw = LineBlockCharacters::canDraw(character);
return LineBlockCharacters::canDraw(lhs.character) == lineDraw;
};
inline bool hasSameAttributes(Character lhs) const
{
return hasSameColors(lhs) && hasSameRendition(lhs) && hasSameLineDrawStatus(lhs) && isSameScript(lhs);
}
};
constexpr bool operator==(const Character &a, const Character &b)
......
......@@ -111,9 +111,7 @@ void TerminalPainter::drawContents(Character *image,
while (isInsideDrawArea(x + len)) {
Character next_char = image[display->loc(x + len, y)];
if (!char_value.hasSameColors(next_char) || !char_value.hasSameRendition(next_char) || !hasSameWidth(x + len)
|| !char_value.hasSameLineDrawStatus(next_char) || !char_value.isSameScript(next_char)
|| !next_char.canBeGrouped(bidiEnabled, doubleWidth)) {
if (!hasSameWidth(x + len) || !next_char.canBeGrouped(bidiEnabled, doubleWidth) || !char_value.hasSameAttributes(next_char)) {
break;
}
......
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