From 593d743240bc8bdce8d18b1c0e2b9180a0651a7d Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 20 Feb 2004 23:23:13 +0000 Subject: Patch from John Ehresman to fix segfault on long lines. --- gtk/PlatGTK.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 52977a6f7..3cdc0abfd 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -1186,11 +1186,11 @@ void SurfaceImpl::DrawTextBase(PRectangle rc, Font &font_, int ybase, const char gdk_draw_text_wc(drawable, PFont(font_)->pfont, gc, x, ybase, wcp, lenDraw); wclen -= lenDraw; - wcp += lenDraw; if (wclen > 0) { // Avoid next calculation if possible as may be expensive x += gdk_text_width_wc(PFont(font_)->pfont, wcp, lenDraw); } + wcp += lenDraw; } } } @@ -1200,10 +1200,10 @@ void SurfaceImpl::DrawTextBase(PRectangle rc, Font &font_, int ybase, const char gdk_draw_text(drawable, PFont(font_)->pfont, gc, x, ybase, s, lenDraw); len -= lenDraw; - s += lenDraw; if (len > 0) { // Avoid next calculation if possible as may be expensive x += gdk_text_width(PFont(font_)->pfont, s, lenDraw); } + s += lenDraw; } } } -- cgit v1.2.3