Author: fabien
Date: 2008-02-26 06:21:23 -0800 (Tue, 26 Feb 2008)
New Revision: 6049
Log:
Fixed underscore shortcut sticked to letter under some platform by introducing 
a generic x,y offset calculation in the drawtext code, indeed underscore size 
and position is not the same from one platform to another, so no assumption on 
it should be taken, tested on mac osx and winxp. Also fixed arc link dependency 
on visualc project files

Modified:
   trunk/ide/visualc/arc.dsp
   trunk/ide/visualc/demo.dsp
   trunk/src/drawtext.cxx

Modified: trunk/ide/visualc/arc.dsp
===================================================================
(Binary files differ)

Modified: trunk/ide/visualc/demo.dsp
===================================================================
(Binary files differ)

Modified: trunk/src/drawtext.cxx
===================================================================
--- trunk/src/drawtext.cxx      2008-02-25 15:18:09 UTC (rev 6048)
+++ trunk/src/drawtext.cxx      2008-02-26 14:21:23 UTC (rev 6049)
@@ -433,9 +433,15 @@
     width = 0;
     if (underscore) {
       if (!fl_hide_underscore) {
-       const char* us = "_";
-       add(0, us, us+1, x, y+ascent, getsize(),getsize(), ascent, spacing);
-      }
+       const char* us = "_"; 
+       // on the some platforms the underscore sticks to the bottom of the 
letter
+       // so add space to enhance the shortcut appearance 
+       // finally, the shortcut symbol should be centered for all platforms 
+       // whatever the font is so add a potential delta
+       int xdelta = (int) (getwidth(p,1)-getwidth(us,1))/2;
+       int ydelta = getsize()<=ascent ? 0 : (int) getsize() - ascent;
+       add(0, us, us+1, x+xdelta, y+ascent+ydelta, getsize(),getsize(), 
ascent, spacing);
+}
       p = q;
     } else if (symbol) {
       if (!symbol_w) {

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

Reply via email to