DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2731
Version: 1.3-current


I was just playing with the editor test, which still has the modifications
that I mentioned recently in the STR about the scrollbar.
Valgrind said:

==22622== Conditional jump or move depends on uninitialised value(s)
==22622==    at 0x8081FD8: clip_to_short(int&, int&, int&, int&)
(fl_rect.cxx:123)
==22622==    by 0x8082191: Fl_Graphics_Driver::rectf(int, int, int, int)
(fl_rect.cxx:183)
==22622==    by 0x805A32D: fl_rectf(int, int, int, int) (fl_draw.H:206)
==22622==    by 0x806B36F: fl_rectf(int, int, int, int, unsigned int)
(fl_draw.H:208)
==22622==    by 0x8069B46: Fl_Text_Display::draw()
(Fl_Text_Display.cxx:3421)
==22622==    by 0x8053C66: Fl_Group::update_child(Fl_Widget&) const
(Fl_Group.cxx:751)
==22622==    by 0x8053B31: Fl_Group::draw_children() (Fl_Group.cxx:726)
==22622==    by 0x806E751: Fl_Window::draw() (Fl_Window.cxx:104)
==22622==    by 0x8051A96: Fl_Double_Window::flush(int)
(Fl_Double_Window.cxx:361)
==22622==    by 0x80518D8: Fl_Double_Window::flush()
(Fl_Double_Window.cxx:316)
==22622==    by 0x80509AC: Fl_X::flush() (x.H:160)
==22622==    by 0x804E4F9: Fl::flush() (Fl.cxx:741)

A little printf()ing showed that y sometimes has a crazy value.
Back in Fl_Text_Display.cxx, y comes from mCursorOldY.
mCursorOldY is only used in a couple of places, fortunately.
in draw(), there is:

    int X, Y;
    if (position_to_xy(mCursorPos, &X, &Y)) draw_cursor(X, Y);
    //    else puts("position_to_xy() failed - unable to draw cursor!");
    //printf("drew cursor at pos: %d (%d,%d)\n", mCursorPos, X, Y);
    mCursorOldY = Y;

and Fl_Text_Display::position_to_xy() has code that goes

  /* If position is not displayed, return false */
  if (pos < mFirstChar || (pos > mLastChar && !empty_vlines())) {
    return 0;
  }

instead of setting y.


Link: http://www.fltk.org/str.php?L2731
Version: 1.3-current

_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to