From 0d14fd1e47694008c5bb0a75b01b5bfa5dfafb89 Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Mon, 28 Sep 2020 16:13:26 +0700 Subject: [PATCH] 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. --- addons/godot_xterm/native/src/terminal.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/godot_xterm/native/src/terminal.cpp b/addons/godot_xterm/native/src/terminal.cpp index 2a101e5..7aaa4b5 100644 --- a/addons/godot_xterm/native/src/terminal.cpp +++ b/addons/godot_xterm/native/src/terminal.cpp @@ -493,7 +493,7 @@ std::pair Terminal::get_cell_colors(int row, int col) fb = (float)cell.attr.fb / 255.0; fgcol = Color(fr, fg, fb); - if (cell.attr.fccode) + if (cell.attr.fccode != -1) { palette.insert(std::pair(cell.attr.fccode, Color(fr, fg, fb))); } @@ -512,7 +512,7 @@ std::pair Terminal::get_cell_colors(int row, int col) bb = (float)cell.attr.bb / 255.0; bgcol = Color(br, bg, bb); - if (cell.attr.bccode) + if (cell.attr.bccode != -1) { palette.insert(std::pair(cell.attr.bccode, Color(br, bg, bb))); }