From 17a937723cb3a435231e5964b40d103e4f14daf4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Vigna?= Date: Thu, 17 Jan 2002 10:13:23 +0000 Subject: [PATCH] Fixed small drawing bug in InsetText. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3403 a592a061-630c-0410-9148-cb99ea01b6c8 --- po/POTFILES.in | 1 + src/insets/ChangeLog | 5 +++++ src/insets/insettext.C | 18 ++++++------------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index 2e17638f09..c99cc6e07c 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -9,6 +9,7 @@ src/converter.C src/CutAndPaste.C src/debug.C src/exporter.C +src/ext_l10n.h src/figure_form.C src/figureForm.C src/FontLoader.C diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index d35f3dbacd..817a8a68ad 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2002-01-17 Juergen Vigna + + * insettext.C (draw): width() function was called without setting + the right top_x which could lead to wrong insetWidth setting! + 2002-01-16 Jean-Marc Lasgouttes * insetbib.C (getFiles): uncomment Path variable. diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 1e778567c1..f2cec46c17 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -350,15 +350,13 @@ void InsetText::draw(BufferView * bv, LyXFont const & f, int old_x = top_x; if (top_x != int(x)) { top_x = int(x); + topx_set = true; int nw = getMaxWidth(bv, this); if (nw > 0 && old_max_width != nw) { need_update = INIT; old_max_width = nw; bv->text->status(bv, LyXText::CHANGED_IN_DRAW); - topx_set = true; return; - } else { - top_x = old_x; } } @@ -370,15 +368,11 @@ void InsetText::draw(BufferView * bv, LyXFont const & f, // repaint the background if needed if (cleared && backgroundColor() != LColor::background) { - top_x = int(x); clearInset(bv, baseline, cleared); - top_x = old_x; } // no draw is necessary !!! if ((drawFrame_ == LOCKED) && !locked && !par->size()) { - top_x = int(x); - topx_set = true; top_baseline = baseline; x += width(bv, f); if (need_update & CLEAR_FRAME) @@ -392,15 +386,15 @@ void InsetText::draw(BufferView * bv, LyXFont const & f, x += static_cast(scroll()); // if top_x differs we did it already - if (!cleared && (top_x == int(x)) + if (!cleared && (old_x == int(x)) && ((need_update&(INIT|FULL)) || (top_baseline != baseline) - ||(last_drawn_width != insetWidth))) { + ||(last_drawn_width != insetWidth))) + { // Condition necessary to eliminate bug 59 attachment 37 - if (baseline > 0) clearInset(bv, baseline, cleared); + if (baseline > 0) + clearInset(bv, baseline, cleared); } - top_x = int(x); - topx_set = true; if (cleared) frame_is_visible = false; -- 2.39.2