From 46b95656bd81eca7360a9f16c470c79cf4e7af34 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 15 Jan 2014 01:15:27 +0100 Subject: [PATCH] [DEV] update at the new distance field --- sources/appl/Gui/TextViewer.cpp | 13 +++++++++---- sources/appl/Gui/TextViewer.h | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/sources/appl/Gui/TextViewer.cpp b/sources/appl/Gui/TextViewer.cpp index e39a88c..2cf8a91 100644 --- a/sources/appl/Gui/TextViewer.cpp +++ b/sources/appl/Gui/TextViewer.cpp @@ -69,6 +69,11 @@ appl::TextViewer::~TextViewer(void) { appl::ViewerManager::release(m_viewerManager); } +void appl::TextViewer::changeZoom(float _range) { + m_displayText.setFontSize(m_displayText.getSize() + _range); + markToRedraw(); +} + bool appl::TextViewer::calculateMinSize(void) { m_minSize.setValue(50,50); return true; @@ -98,7 +103,7 @@ void appl::TextViewer::onRegenerateDisplay(void) { if (m_buffer == NULL) { m_maxSize.setX(256); m_maxSize.setY(256); - m_displayText.setTextAlignement(10, m_size.x()-20, ewol::compositing::Text::alignLeft); + m_displayText.setTextAlignement(10, m_size.x()-20, ewol::compositing::alignLeft); m_displayText.setRelPos(vec3(10, 0, 0)); std::string tmpString("
\n" "\n" @@ -574,7 +579,7 @@ appl::Buffer::Iterator appl::TextViewer::getMousePosition(const vec2& _relativeP } else { //note : Without this condithion the time od selection change to 0.6 ms to 8ms ... //APPL_DEBUG("check : " << -_relativePos.y() << ">=" << positionCurentDisplay.y()); - m_displayText.print(stringToDisplay[kkk]); + m_displayText.printChar(stringToDisplay[kkk]); ++countColomn; } } @@ -943,7 +948,7 @@ appl::Buffer::Iterator appl::TextViewer::getPosSize(const appl::Buffer::Iterator if (stringToDisplay[kkk] == u32char::Return) { return it; } else { - m_displayText.print(stringToDisplay[kkk]); + m_displayText.printChar(stringToDisplay[kkk]); } } if (m_displayText.getPos().x() >= _distance) { @@ -972,7 +977,7 @@ float appl::TextViewer::getScreenSize(const appl::Buffer::Iterator& _startLinePo if (stringToDisplay[kkk] == u32char::Return) { return m_displayText.getPos().x() + 2; // TODO : Add the +2 for the end of line ... } else { - m_displayText.print(stringToDisplay[kkk]); + m_displayText.printChar(stringToDisplay[kkk]); } } ret = m_displayText.getPos().x(); diff --git a/sources/appl/Gui/TextViewer.h b/sources/appl/Gui/TextViewer.h index 1e7e8fd..0f6cd29 100644 --- a/sources/appl/Gui/TextViewer.h +++ b/sources/appl/Gui/TextViewer.h @@ -15,6 +15,7 @@ #include #include +#include #include #include #include @@ -66,6 +67,7 @@ namespace appl { virtual void onEventClipboard(enum ewol::context::clipBoard::clipboardListe _clipboardID); virtual void onGetFocus(void); virtual void onLostFocus(void); + virtual void changeZoom(float _range); private: float m_lastOffsetDisplay; //!< Line number ofssed in the display private: