From 4be2b9b40f84b27290b686f02c178c6977bbab4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Vigna?= Date: Mon, 11 Mar 2002 14:04:41 +0000 Subject: [PATCH] Force redraw of row if we changed (John's patch fix for #268) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3708 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/ChangeLog | 1 + src/insets/insetgraphics.C | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 544e7fcebc..e1628deffc 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,6 +1,7 @@ 2002-03-11 Juergen Vigna * insetgraphics.C (draw): hack to fix the redrawing bug. + (draw): seems this fixes #268 (force redraw of row if we changed). * insettext.C (updateInsetInInset): fixed for updates in insets inside this inset text (don't know why I missed this earlier). diff --git a/src/insets/insetgraphics.C b/src/insets/insetgraphics.C index 9f2063250c..6391435bc7 100644 --- a/src/insets/insetgraphics.C +++ b/src/insets/insetgraphics.C @@ -322,7 +322,8 @@ void InsetGraphics::draw(BufferView * bv, LyXFont const & font, // This will draw the graphics. If the graphics has not been loaded yet, // we draw just a rectangle. Painter & paint = bv->painter(); - + grfx::ImageStatus old_status_ = cached_status_; + if (drawImage()) { // lyxerr << "IG(" << this << "): " << old_x << endl; paint.image(old_x + 2, baseline - lascent, @@ -354,6 +355,12 @@ void InsetGraphics::draw(BufferView * bv, LyXFont const & font, } } + // the status message may mean we changed size, so indicate + // we need a row redraw + if (old_status_ != cached_status_) { + bv->getLyXText()->status(bv, LyXText::CHANGED_IN_DRAW); + } + // Reset the cache, ready for the next draw request cached_status_ = grfx::ErrorUnknown; cached_image_.reset(0);