From ee808714342691a24c7d58fe513265209a95a6f2 Mon Sep 17 00:00:00 2001 From: Edouard Dupin Date: Tue, 24 Jan 2012 23:50:23 +0100 Subject: [PATCH] Add the display of the space and tabulation --- jni/edn/Buffer/BufferText.cpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/jni/edn/Buffer/BufferText.cpp b/jni/edn/Buffer/BufferText.cpp index 62e984f..47b00be 100644 --- a/jni/edn/Buffer/BufferText.cpp +++ b/jni/edn/Buffer/BufferText.cpp @@ -348,7 +348,7 @@ int32_t BufferText::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DC uint32_t xx = 0; int32_t idX = 0; - color_ts bgColor; //!< Text color + color_ts bgColor; color_ts & tmpppppp = myColorManager->Get(COLOR_CODE_BASIC_BG); OOColored->SetColor(tmpppppp); OOColored->Rectangle( 0, 0, sizeX, sizeY); @@ -391,19 +391,36 @@ int32_t BufferText::Display(ewol::OObject2DTextColored* OOText, ewol::OObject2DC selectColor = HLColor->patern->GetColor(); } } + bool haveBg = false; if( true == selHave && selStart <= iii && selEnd > iii) { selectColor = myColorSel; + OOColored->SetColor(selectColor->GetBG()); + haveBg = selectColor->HaveBg(); + } else { + if( ' ' == currentChar + && true == globals::IsSetDisplaySpaceChar() ) + { + OOColored->SetColor(myColorSpace); + haveBg = true; + } else if( '\t' == currentChar + && true == globals::IsSetDisplaySpaceChar() ) + { + OOColored->SetColor(myColorTab); + haveBg = true; + } else { + OOColored->SetColor(selectColor->GetBG()); + haveBg = selectColor->HaveBg(); + } } - OOColored->SetColor(selectColor->GetBG()); OOText->SetColor(selectColor->GetFG()); coord2D_ts textPos; textPos.x = pixelX-m_displayStartPixelX; textPos.y = y; drawSize = OOText->TextAdd(textPos, drawClipping, displayChar); - if (true == selectColor->HaveBg() ) { + if (true == haveBg ) { OOColored->Rectangle( pixelX, y, drawSize, letterHeight, drawClipping); } }