octal-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: arrows sometimes flipped


From: David O'Toole
Subject: Re: arrows sometimes flipped
Date: Wed Feb 28 17:06:02 2001

I'd noticed that once or twice, but forgotten about it... thanks for
pointing it out (and finding a bugfix too! :-). This is very helpful.

-dave

> 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
>
> _______________________________________________
> Octal-dev mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/octal-dev
>

-- 
@@@ david o'toole
@@@ address@hidden
@@@ www.gnu.org/software/octal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]