[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
arrows sometimes flipped
From: |
Richard Todd |
Subject: |
arrows sometimes flipped |
Date: |
Mon Feb 26 19:18:10 2001 |
All,
I noticed when a machine is connected to another machine,
such that the arrow should point -->--, it sometimes
faces the wrong way. It only happens when the line
is completely horizontal (dy == 0). I found the bug,
and here's a cleaned up version of the code in
engine_view.c:
-----------------------------------------------------
if (dy == 0) theta = ((dx<=0)?0:PI);
else {
theta = atan(((double)dx)/((double)dy));
theta = (PI/2.0) - theta; // we want the complementary angle
if (sy < ky)
theta += PI;
}
if(theta)
poly_rotate(poly, 3, theta);
// now we can draw....
---------------------------------------------------
It fixes the flipping problem, and also combines the two
potential calls to poly_rotate() into one.
Nice to see the project picking up steam!
Richard Todd
- arrows sometimes flipped,
Richard Todd <=