Subject: Bug#4306: gs and rounded corner rectangle

From: Thomas Koenig <[email-masked]>
Date: Tue, 27 Aug 1996 10:51:19 +0200 (MET DST)

Package: gs
Version: 4.01-2

A rectangle drawn with rounded corners from xfig is not displayed
correctly with gs 4.01-2.

The following patch is supposed to fix this, according to an article
I read in the news.

*** gspath1.c.orig      Fri Jul 26 09:17:35 1996
--- gspath1.c   Fri Jul 26 09:18:35 1996
***************
*** 170,176 ****
                        yt0 = ay1 + dy0 * l0;
                        xt2 = ax1 + dx2 * l2;
                        yt2 = ay1 + dy2 * l2;
!                       code = arc_add(pgs, true, arad, xt0, yt0, xt2, yt2, ax1, ay1);
                   }
           }
        if ( retxy != 0 )
--- 170,176 ----
                        yt0 = ay1 + dy0 * l0;
                        xt2 = ax1 + dx2 * l2;
                        yt2 = ay1 + dy2 * l2;
!                       code = arc_add(pgs, arc_lineto, arad, xt0, yt0, xt2, yt2, ax1, ay1);
                   }
           }
        if ( retxy != 0 )

Here's an example which triggers the bug.

#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 1996-08-27 10:47 MET DST by <ig25@mvmap83>.
# Source directory was `/home/ig25'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#   2790 -rw-r----- unnamed.eps
#    130 -rw-r----- unnamed.fig
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
  if test "$gettext_dir" = FAILED && test -f $dir/gettext \
     && ($dir/gettext --version >/dev/null 2>&1)
  then
    set `$dir/gettext --version 2>&1`
    if test "$3" = GNU
    then
      gettext_dir=$dir
    fi
  fi
  if test "$locale_dir" = FAILED && test -f $dir/shar \
     && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
  then
    locale_dir=`$dir/shar --print-text-domain-dir`
  fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
  echo=echo
else
  TEXTDOMAINDIR=$locale_dir
  export TEXTDOMAINDIR
  TEXTDOMAIN=sharutils
  export TEXTDOMAIN
  echo="$gettext_dir/gettext -s"
fi
touch -am 1231235999 $$.touch >/dev/null 2>&1
if test ! -f 1231235999 && test -f $$.touch; then
  shar_touch=touch
else
  shar_touch=:
  echo
  $echo 'WARNING: not restoring timestamps.  Consider getting and'
  $echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 1231235999 $$.touch
#
if mkdir _sh19142; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= unnamed.eps ==============
if test -f 'unnamed.eps' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'unnamed.eps' '(file already exists)'
else
  $echo 'x -' extracting 'unnamed.eps' '(binary)'
  sed 's/^X//' << 'SHAR_EOF' | uudecode &&
SHAR_EOF
  $shar_touch -am 0827104396 'unnamed.eps' &&
  chmod 0640 'unnamed.eps' ||
  $echo 'restore of' 'unnamed.eps' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'unnamed.eps:' 'MD5 check failed'
d1552e8761be4db8312cb97d8dfb0ffc  unnamed.eps
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'unnamed.eps'`"
    test 2790 -eq "$shar_count" ||
    $echo 'unnamed.eps:' 'original size' '2790,' 'current size' "$shar_count!"
  fi
fi
# ============= unnamed.fig ==============
if test -f 'unnamed.fig' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'unnamed.fig' '(file already exists)'
else
  $echo 'x -' extracting 'unnamed.fig' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'unnamed.fig' &&
#FIG 3.1
Landscape
Center
Inches
1200 2
2 4 0 1 -1 7 0 0 -1 0.000 0 0 7 0 0 5
X	 2400 2325 2400 1275 1050 1275 1050 2325 2400 2325
SHAR_EOF
  $shar_touch -am 0827104396 'unnamed.fig' &&
  chmod 0640 'unnamed.fig' ||
  $echo 'restore of' 'unnamed.fig' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'unnamed.fig:' 'MD5 check failed'
185a0d8b3fb93b6b8b8201ac341071cc  unnamed.fig
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'unnamed.fig'`"
    test 130 -eq "$shar_count" ||
    $echo 'unnamed.fig:' 'original size' '130,' 'current size' "$shar_count!"
  fi
fi
rm -fr _sh19142
exit 0
-- 
Thomas Koenig, [email-masked], [email-masked].
The joy of engineering is to find a straight line on a double
logarithmic diagram.