Author: matt
Date: 2009-09-19 13:57:48 -0700 (Sat, 19 Sep 2009)
New Revision: 6887
Log:
Fl_Input_: improved draing and warping for large fonts

Modified:
   branches/branch-1.3/src/Fl_Input_.cxx

Modified: branches/branch-1.3/src/Fl_Input_.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Input_.cxx       2009-09-19 20:52:36 UTC (rev 
6886)
+++ branches/branch-1.3/src/Fl_Input_.cxx       2009-09-19 20:57:48 UTC (rev 
6887)
@@ -239,6 +239,7 @@
   // count how many lines and put the last one into the buffer:
   // And figure out where the cursor is:
   int height = fl_height();
+  int threshold = height/2;
   int lines;
   int curx, cury;
   for (p=value(), curx=cury=lines=0; ;) {
@@ -248,15 +249,15 @@
       if (Fl::focus()==this && !was_up_down) up_down_pos = curx;
       cury = lines*height;
       int newscroll = xscroll_;
-      if (curx > newscroll+W-20) {
+      if (curx > newscroll+W-threshold) {
        // figure out scrolling so there is space after the cursor:
-       newscroll = curx+20-W;
+       newscroll = curx+threshold-W;
        // figure out the furthest left we ever want to scroll:
        int ex = int(expandpos(p, e, buf, 0))+2-W;
        // use minimum of both amounts:
        if (ex < newscroll) newscroll = ex;
-      } else if (curx < newscroll+20) {
-       newscroll = curx-20;
+      } else if (curx < newscroll+threshold) {
+       newscroll = curx-threshold;
       }
       if (newscroll < 0) newscroll = 0;
       if (newscroll != xscroll_) {

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

Reply via email to