[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gEDA-dev: World vs. screen coordinates...
On Sat, 2006-12-23 at 20:16 +0100, Carlos Nieves Ónega wrote:
> Hi Peter,
> You are right. Screen coords and world coords have different sense.
> You can check it opening gschem, and showing the coordinates windows (oc
> hotkey).
>
> Regards,
>
> Carlos
So it is... I've never noticed the coordinate window before! I remember
having some difficulties with bounds checking for hit-detection in world
coords - (And grip locations too), due to the apparent need to change
the sign of any addition or subtraction intended to operate in a
particular direction.
I think then, there are a few bugs in gschem's object world bounds
functions. (I've corrected in my big diff which I'm separating).
Sometimes, the code assigns *top for a world bound, to the min() of
various coords, where for world coords it should be max() according to
our observations in the coord window.
Cases I've got fixed here are:
world_get_box_bounds()
world_get_bus_bounds()
world_get_circle_bounds()
world_get_line_bounds()
world_get_net_bounds()
world_get_picture_bounds()
world_get_pin_bounds()
(I've changed many implementations to look like:
+ *left = min( line->x[0], line->x[1] );
+ *top = max( line->y[0], line->y[1] );
+ *right = max( line->x[0], line->x[1] );
+ *bottom = min( line->y[0], line->y[1] );
)
This anomaly is quite prevalent thought the code.. Is it possible that
world coordinates were never _meant_ to be opposite to screen-coords in
up/down sense?
Ales - is there a definition of world / screen coords, and their origins
+ senses?
Happy Holidays... its 25th now, so Merry Christmas to those who
celebrate it!
Peter C.
_______________________________________________
geda-dev mailing list
geda-dev@moria.seul.org
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev