Subject: Menu arrows ugly

From: [email-masked]
Date: Wed, 27 Jan 1999 21:04:18 -0600 (CST)

Full_Name: Adam Rice
Version: 2.1.10
CVS_Date: 
OS: Linux 2.0.36
X_Server: Xfree86 3.3.3
Submission from: (NULL) (193.133.58.145)

The menu arrows are a nasty ugly shape for those of us using relatively
low-res monitors, because of the effects of rounding errors. You get used
to it after a while, but I noticed it today because I was fiddling with
my menus and thinking about what would make them look better. These sort
of few-misplaced-pixels errors add up to make a system look
unprofessional.
One of the ways in which qvwm kicks fvwm95's butt is getting everything
right down to the pixel level, and it just looks better.

Anyway, I digress. I've made a small patch for my own use that reduces the
size of the triangle so that it is vertically symmetrical and the
"jaggies"
are minimised. I don't think it breaks anything, but it could be
considered
"bloat" as it adds an extra bit of maths to each triangle draw. A more
general approach would be to allow the window button drawing code to be
used
for menu triangles, giving all the flexibility that allows. Then I could
have
anti-aliased arrows, and would be happy happy happy.

Patch follows.

*** menus.c.old Wed Jan 20 01:50:15 1999
--- menus.c     Thu Jan 28 02:18:03 1999
***************
*** 1935,1940 ****
--- 1935,1961 ----
  
    m = (u + b)/2;
  
+   /**************************************************************************
+    *
+    * anti-ugliness patch by Adam Rice, [email-masked],
+    * January 28th 1998.
+    *
+    **************************************************************************/
+ 
+   /* ensure vertical symmetry */
+   if (u-m > m-b) {
+     u=2*m-b;
+   } else if (u-m < m-b) {
+     b=2*m-u;
+   }
+ 
+   /* make (r-l)/(m-b) or its inverse be a whole number */
+   if (r-l > m-b) {
+     r=((r-l)/(m-b))*(m-b)+l;
+   } else if (r-l < m-b) {
+     r=(m-b)/((((m-b)-1)/(r-l))+1)+l;
+   }
+   
    if (!relief) {
      /* solid triangle */
      XPoint points[3];

--
Visit the official FVWM web page at <URL:http://fvwm.math.uh.edu/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].