Menu

#1807 Arc item anomalies under Windows

obsolete: 8.4.7
open
5
2004-12-08
2004-12-08
No

WinXP Pro SP2 / ActiveTCL 8.4.7

Canvas arc items seem to have a few (rounding related?)
issues that cause various display problems. The
problems are illustrated in the following script:

=============
canvas .c -width 400 -height 400
pack .c

# four radiused corners
.c create arc 100 300 200 200 \
-start 180 -extent 90 -style arc
.c create arc 100 100 200 200 \
-start 90 -extent 90 -style arc
.c create arc 200 100 300 200 \
-start 0 -extent 90 -style arc
.c create arc 200 200 300 300 \
-start 270 -extent 90 -style arc

# center arc segment
.c create arc 190 190 210 210 -start 3 -extent 5

# edge lines
.c create line 150 100 250 100
.c create line 150 300 250 300
.c create line 100 150 100 250
.c create line 300 150 300 250
========

The code just creates a square with radiused corners
and an internal arc segment. Using Windows XP Pro SP2
and ActiveTCL 8.4.7, I notice the following:

1. The arc in the upper left hand corner does not
connect with the left hand vertical line (at its 9 o'clock
position)
2. The arc in the lower left hand corner does not
connect with the lower horizontal line (at its 6 o'clock
position)
3. The arc draw in the center of the figure (described as
a total of 5 included degrees) is drawn as a complete
circle.

If you comment out the "-style arc" option on the first 4
arcs and comment out the 4 line segments, you can see
some problems with the several of the "corner" arcs with
respect to how their endpoints relate to the edges of
the "pie slice". For instance, on the lower left hand arc,
the 6 o'clock position doesn't quite meet the edge and
the 9 o'clock position is drawn a pixel or two past the
edge. This, in turn, is what leads to the "gaps" seen in
the test program.

Interestingly, running the same example on the same
hardware, but under Linux (in this case, Puppy Linux)
everything looks as expected. The outer object
boundary appears to be completely connected, and the
center arc segment is drawn correctly (not as a
complete circle).

Jeff

Discussion

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2005-05-31

    Logged In: YES
    user_id=72656

    see also 1187074

     
  • Ed Hume

    Ed Hume - 2007-09-25

    Logged In: YES
    user_id=625620
    Originator: NO

    On windows only small arc extents can be drawn incorrectly when a repaint occurs. I have seen this with extents up to 3 with Tk 8.4.11. For example,

    canvas .c
    pack .c
    .c create arc 88 88 112 112 -style arc -start -270 -width 2 -extent 2
    # Tiny arc above is drawn correctly at first, now use the mouse to
    # select and drag on the window border. The arc is redrawn as a circle.

    In some situations the repaint does not seem necessary - the incorrect circles are drawn at once. I do not know why the above example requires a repaint.

    As a workaround, small line segments can be drawn for tiny arcs.

    Regards,
    Ed

     
MongoDB Logo MongoDB