mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-10 04:40:25 +01:00
Don't cache true colors
If a true color has been set it will have code -1 regardless of the actual color. Therefore, it shouldn't be stored in the color cache dictionary otherwise all true color cells will be colored the most recently set value.
This commit is contained in:
parent
0130ce96db
commit
0d14fd1e47
1 changed files with 2 additions and 2 deletions
|
@ -493,7 +493,7 @@ std::pair<Color, Color> Terminal::get_cell_colors(int row, int col)
|
||||||
fb = (float)cell.attr.fb / 255.0;
|
fb = (float)cell.attr.fb / 255.0;
|
||||||
fgcol = Color(fr, fg, fb);
|
fgcol = Color(fr, fg, fb);
|
||||||
|
|
||||||
if (cell.attr.fccode)
|
if (cell.attr.fccode != -1)
|
||||||
{
|
{
|
||||||
palette.insert(std::pair<int, Color>(cell.attr.fccode, Color(fr, fg, fb)));
|
palette.insert(std::pair<int, Color>(cell.attr.fccode, Color(fr, fg, fb)));
|
||||||
}
|
}
|
||||||
|
@ -512,7 +512,7 @@ std::pair<Color, Color> Terminal::get_cell_colors(int row, int col)
|
||||||
bb = (float)cell.attr.bb / 255.0;
|
bb = (float)cell.attr.bb / 255.0;
|
||||||
bgcol = Color(br, bg, bb);
|
bgcol = Color(br, bg, bb);
|
||||||
|
|
||||||
if (cell.attr.bccode)
|
if (cell.attr.bccode != -1)
|
||||||
{
|
{
|
||||||
palette.insert(std::pair<int, Color>(cell.attr.bccode, Color(br, bg, bb)));
|
palette.insert(std::pair<int, Color>(cell.attr.bccode, Color(br, bg, bb)));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue