]> git.lyx.org Git - features.git/commitdiff
Force redraw of row if we changed (John's patch fix for #268)
authorJürgen Vigna <jug@sad.it>
Mon, 11 Mar 2002 14:04:41 +0000 (14:04 +0000)
committerJürgen Vigna <jug@sad.it>
Mon, 11 Mar 2002 14:04:41 +0000 (14:04 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3708 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/ChangeLog
src/insets/insetgraphics.C

index 544e7fcebcad3f8aa6fdc65908411577278c04c1..e1628deffc5b64795d2cd46f78c8fb36faafed6d 100644 (file)
@@ -1,6 +1,7 @@
 2002-03-11  Juergen Vigna  <jug@sad.it>
 
        * 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).
index 9f2063250c26a59accd5f4d812824f21ae9f255d..6391435bc755c04a342a737870db4fa30fbd1147 100644 (file)
@@ -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);