On Tue, Nov 11, 2003 at 12:24:37AM +0100, Alfredo Braunstein wrote:
> But we need to rationalize the update calls anyway, and when we do that, we
> can add an LCursor::update_cache method or something to update the cache at
> the exact moment we want (I think after an update, in workAreadispatch).
>
> Comments?
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.458
diff -u -p -u -r1.458 BufferView_pimpl.C
--- BufferView_pimpl.C 10 Nov 2003 18:15:52 -0000 1.458
+++ BufferView_pimpl.C 10 Nov 2003 23:02:23 -0000
@@ -346,6 +346,18 @@ bool BufferView::Pimpl::fitCursor()
bool ret;
#ifndef LOCK
+ int x,y;
+
+ bv_->cursor().getPos(x, y);
+
+ if (y < top_y() || y > top_y() + workarea().workHeight()) {
+ int newtop = y - workarea().workHeight() / 2;
+ newtop = std::max(0, newtop);
+ top_y(newtop);
+ return true;
+ }
+ return false;
+
UpdatableInset * tli = ////////
static_cast<UpdatableInset *>(cursor_.innerInset());
if (tli) {
This chunk looks funny. The lines ////// are never reached, are they?
[This does not mean this is wrong, just not "optimal"]
Apart from that it looks good.
Andre'
--
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one. (T. Jefferson or B. Franklin or both...)