From 0e8c41821002489811317874d941e519b683cfea Mon Sep 17 00:00:00 2001 From: fluxgen Date: Wed, 11 Aug 2004 12:41:28 +0000 Subject: fixed fbrun crash when history item is bigger than entry box, sf: [ 1005182 ] fix for Bug with RequestID #877004, patch from mangala --- src/FbTk/TextBox.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/FbTk/TextBox.cc b/src/FbTk/TextBox.cc index 460db7e..a23f9a6 100644 --- a/src/FbTk/TextBox.cc +++ b/src/FbTk/TextBox.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: TextBox.cc,v 1.10 2004/07/15 13:48:54 fluxgen Exp $ +// $Id: TextBox.cc,v 1.11 2004/08/11 12:41:28 fluxgen Exp $ #include "TextBox.hh" #include "Font.hh" @@ -278,7 +278,10 @@ void TextBox::adjustEndPos() { } void TextBox::adjustStartPos() { - int text_width = font().textWidth(text().c_str() + m_start_pos, m_end_pos - m_start_pos); + // reset global start po + m_start_pos = 0; + + int text_width = font().textWidth(text().c_str(), m_end_pos); if (text_width < static_cast(width())) return; -- cgit v0.11.2