# HG changeset patch # User izzni # Date 1682215910 18000 # Node ID b7e43b28bee12853aff89468ccdfcea1a526234f # Parent 29d9b5bc79464348660298d90cbeab288f613e84 Fix character truncation when screen is flipped. This was causing the dive computer to lock up when in English Units with the screen flipped when the first decompression stop is shown using FONT_105. diff -r 29d9b5bc7946 -r b7e43b28bee1 Discovery/Src/gfx_engine.c --- a/Discovery/Src/gfx_engine.c Fri Apr 21 09:48:23 2023 +0200 +++ b/Discovery/Src/gfx_engine.c Sat Apr 22 21:11:50 2023 -0500 @@ -2371,8 +2371,14 @@ // ----------------------------- char_truncated_WidthFlag = 0; - width_left = hgfx->Image->ImageWidth - (hgfx->WindowX0 + cfg->Xdelta); - + if(!pSettings->FlipDisplay) + { + width_left = hgfx->Image->ImageWidth - (hgfx->WindowX0 + cfg->Xdelta); + } + else + { + width_left = (hgfx->WindowX1 - cfg->Xdelta); + } if(width_left < width) { char_truncated_WidthFlag = 1; @@ -2764,7 +2770,14 @@ // ----------------------------- char_truncated_WidthFlag = 0; - width_left = hgfx->Image->ImageWidth - (hgfx->WindowX0 + cfg->Xdelta); + if(!pSettings->FlipDisplay) + { + width_left = hgfx->Image->ImageWidth - (hgfx->WindowX0 + cfg->Xdelta); + } + else + { + width_left = (hgfx->WindowX1 - cfg->Xdelta); + } if(width_left < width) { char_truncated_WidthFlag = 1;