I’m trying to accomplish the simple task of drawing two circles in random places on a GraphicsContext and connecting their centers with a line segment. However, the circles always appear below and to the right of the endpoints of the line. I have observed this using both StrokeLine and DrawLines, on windows 7/python2.7/wx 2.8.12.1 and centos 6/python2.6/wx 2.8.12.0 . Can someone please help me figure out how to accomplish this? Sorry if it’s a dumb question but I couldn’t find any info on the subject anywhere.
I wanted to test your module but running it gave me a TabError because you are mixing tabs and spaces. Never do that. Haven’t you read PEP 8? I’m sure no one would go through the hassle of fixing all tabs to spaces just to fix your module and then to be able to run it and see what’s the issue in it. First off, fix your module so that it has no tab whitespace in it, then resend it. Thanks.
I’m trying to accomplish the simple task of drawing two circles in random places on a GraphicsContext and connecting their centers with a line segment. However, the circles always appear below and to the right of the endpoints of the line. I have observed this using both StrokeLine and DrawLines, on windows 7/python2.7/wx 2.8.12.1 and centos 6/python2.6/wx 2.8.12.0 . Can someone please help me figure out how to accomplish this?
I'm trying to accomplish the simple task of drawing two circles in
random places on a GraphicsContext and connecting their centers with a
line segment. However, the circles always appear below and to the right
of the endpoints of the line. I have observed this using both StrokeLine
and DrawLines, on windows 7/python2.7/wx 2.8.12.1 and centos
6/python2.6/wx 2.8.12.0 . Can someone please help me figure out how to
accomplish this? Sorry if it's a dumb question but I couldn't find any
info on the subject anywhere.
When you call DrawEllipse you pass the upper-left corner of the rectangle that contains the ellipse, as well as the width and height. So when you draw a line to/from those same coordinates then you are connecting the rectangle corners, not the centers of the ellipses.
Ah, that makes perfect sense. Thank you very much for your help.
···
On Saturday, August 10, 2013 1:29:39 PM UTC-7, Robin Dunn wrote:
David Howard wrote:
Hi All,
I’m trying to accomplish the simple task of drawing two circles in
random places on a GraphicsContext and connecting their centers with a
line segment. However, the circles always appear below and to the right
of the endpoints of the line. I have observed this using both StrokeLine
and DrawLines, on windows 7/python2.7/wx 2.8.12.1 and centos
6/python2.6/wx 2.8.12.0 . Can someone please help me figure out how to
accomplish this? Sorry if it’s a dumb question but I couldn’t find any
info on the subject anywhere.
When you call DrawEllipse you pass the upper-left corner of the
rectangle that contains the ellipse, as well as the width and height.
So when you draw a line to/from those same coordinates then you are
connecting the rectangle corners, not the centers of the ellipses.