void BufferView::Pimpl::updateScrollbar()
{
- /* If the text is smaller than the working area, the scrollbar
- * maximum must be the working area height. No scrolling will
- * be possible */
if (!bv_->text) {
+ lyxerr[Debug::GUI] << "no text in updateScrollbar" << endl;
workarea_.setScrollbar(0, 1.0);
return;
}
long const text_height = bv_->text->height;
long const work_height = workarea_.height();
+ double const lineh = bv_->text->defaultHeight();
+ double const slider_size =
+ (text_height == 0) ? 1.0 : 1.0 / double(text_height);
+
+ lyxerr[Debug::GUI] << "text_height now " << text_height << endl;
+ lyxerr[Debug::GUI] << "work_height " << work_height << endl;
+
+ /* If the text is smaller than the working area, the scrollbar
+ * maximum must be the working area height. No scrolling will
+ * be possible */
if (text_height <= work_height) {
+ lyxerr[Debug::GUI] << "doc smaller than workarea !" << endl;
workarea_.setScrollbarBounds(0.0, 0.0);
current_scrollbar_value = bv_->text->first_y;
workarea_.setScrollbar(current_scrollbar_value, 1.0);
return;
}
- double const lineh = bv_->text->defaultHeight();
- double const slider_size =
- (text_height == 0) ? 1.0 : 1.0 / double(text_height);
-
- static long old_text_height;
- static double old_lineh;
- static double old_slider_size;
-
- if (text_height != old_text_height) {
- workarea_.setScrollbarBounds(0.0,
- text_height - work_height);
- old_text_height = text_height;
- }
- if (lineh != old_lineh) {
- workarea_.setScrollbarIncrements(lineh);
- old_lineh = lineh;
- }
- if (current_scrollbar_value != bv_->text->first_y
- || slider_size != old_slider_size) {
- current_scrollbar_value = bv_->text->first_y;
- workarea_.setScrollbar(current_scrollbar_value, slider_size);
- old_slider_size = slider_size;
- }
+ workarea_.setScrollbarBounds(0.0, text_height - work_height);
+ workarea_.setScrollbarIncrements(lineh);
+ current_scrollbar_value = bv_->text->first_y;
+ workarea_.setScrollbar(current_scrollbar_value, slider_size);
}
// Callback for scrollbar slider
void BufferView::Pimpl::scrollCB(double value)
{
+ lyxerr[Debug::GUI] << "scrollCB of " << value << endl;
+
if (!buffer_) return;
current_scrollbar_value = long(value);
+2002-03-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * BufferView_pimpl.C (updateScrollbar): update on buffer switch
+ properly
+
+2002-03-19 John Levon <moz@compsoc.man.ac.uk>
+
+ * CutAndPaste.C: change layouts earlier on paste
+ to avoid crashing when calling getFont()
+
2002-03-22 Angus Leeming <a.leeming@ic.ac.uk>
- * PrinterParams.h: #include "lyxrc.h" and remove that bloody irritating
- #error.
+ * PrinterParams.h: #include "lyxrc.h" and remove that bloody
+ irritating #error.
2002-03-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
// temporary set *par as previous of tmpbuf as we might have to realize
// the font.
tmpbuf->previous(*par);
+
+ // make sure there is no class difference
+ SwitchLayoutsBetweenClasses(textclass, tc, tmpbuf,
+ current_view->buffer()->params);
+
Paragraph::depth_type max_depth = (*par)->getMaxDepthAfter(current_view->buffer());
+
while(tmpbuf) {
// if we have a negative jump so that the depth would go below
// 0 depth then we have to redo the delta to this new max depth
// now reset it to 0
buf->previous(0);
- // make sure there is no class difference
- SwitchLayoutsBetweenClasses(textclass, tc, buf,
- current_view->buffer()->params);
-
// make the buf exactly the same layout than
// the cursor paragraph
buf->makeSameLayout(*par);