]> git.lyx.org Git - features.git/commitdiff
Fix for fitcursor.
authorAbdelrazak Younes <younes@lyx.org>
Thu, 27 Sep 2007 12:04:57 +0000 (12:04 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 27 Sep 2007 12:04:57 +0000 (12:04 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20536 a592a061-630c-0410-9148-cb99ea01b6c8

src/bufferview_funcs.cpp

index 77b1a8e341d9082c6cdde86d1a63c15ee8033136..3b902f1087430cea6392e1edee5eab34bf2a4e0f 100644 (file)
@@ -258,12 +258,10 @@ Point getPos(BufferView const & bv, DocIterator const & dit, bool boundary)
 // FIXME: This does not work within mathed!
 CurStatus status(BufferView const * bv, DocIterator const & dit)
 {
-       // FIXME: it's be better to have something like TextMetrics::status().
-       TextMetrics const & tm = bv->textMetrics(dit.bottom().text());
-       int par_pos = tm.parPosition(dit.bottom().pit());
-       if (par_pos < 0)
+       Point const p = bv_funcs::getPos(*bv, dit, dit.boundary());
+       if (p.y_ < 0)
                return CUR_ABOVE;
-       else if (par_pos > bv->workHeight())
+       else if (p.y_ > bv->workHeight())
                return CUR_BELOW;
                
        return CUR_INSIDE;