FVWM: bug in fvwm_button_pxp8.diff ?

From: Andrew Veliath <veliaa_at_rpi.edu>
Date: Fri, 31 May 1996 17:27:40 -0400

    Patrice> I have a strange problem using the fvwm_button_pxp8.*
    Patrice> patch. I use a pixmap in the 1st left button:
    Patrice> ButtonStyle 1 Pixmap xfoo.xpm

    Patrice> xfoo.xpm is 22x14 pixels and the button size is 19x18
    Patrice> pixels (without the 3d borders). So the pixmap is larger
    Patrice> than the button.

    Patrice> My request trashes the left 3d border drawing. I've
    Patrice> included a small xpm to show the result, as my english
    Patrice> isn't very good :)

Thanks for this detailed report. The problem is the result of a
subtle signed/unsigned addition gone awry. I will post a new patch in
a few days, but here is a quick patch to pxp8 which I think should
alleviate the problem.

Sincerely,
Andrew

diff -cr fvwm-2.0.42.pxp8/fvwm/borders.c fvwm-2.0.42.pxp8a/fvwm/borders.c
*** fvwm-2.0.42.pxp8/fvwm/borders.c Fri May 31 17:19:21 1996
--- fvwm-2.0.42.pxp8a/fvwm/borders.c Fri May 31 17:21:33 1996
***************
*** 422,437 ****
          x = border;
          if (bf->style&HOffCenter) {
              if (bf->style&HRight)
! x += width - p->width;
          } else
! x += (width - p->width) / 2;
  
          y = border;
          if (bf->style&VOffCenter) {
              if (bf->style&VBottom)
! y += height - p->height;
          } else
! y += (height - p->height) / 2;
  
          if (x < border) x = border;
          if (y < border) y = border;
--- 422,437 ----
          x = border;
          if (bf->style&HOffCenter) {
              if (bf->style&HRight)
! x += (int)(width - p->width);
          } else
! x += (int)(width - p->width) / 2;
  
          y = border;
          if (bf->style&VOffCenter) {
              if (bf->style&VBottom)
! y += (int)(height - p->height);
          } else
! y += (int)(height - p->height) / 2;
  
          if (x < border) x = border;
          if (y < border) y = border;
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Fri May 31 1996 - 16:35:28 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:59 BST