Hi Timur,
I really don't know if this could be called a bug. 

Line's width is also taked into account when calculating pin bounds. 
This is due to libgeda/src/o_line_basic.c , world_get_line_bounds
function:

------ begin code snip
  /* This isn't strictly correct, but a 1st order approximation */
  *left   -= halfwidth;
  *top    -= halfwidth;
  *right  += halfwidth;
  *bottom += halfwidth;
------- end code snip

As the comment says, this isn't strictly correct. When you draw a
horizontal line/pin on the screen, it's true that top and bottom bounds
should be enlarged by line's halfwidth, and you see it on the screen.
However, x bounds should not.

Autoplacing attrib code relies on object bounds, so attributes should be
shifted by (-50,0), taking the bound as the reference point.
For example:
  - You draw a pin between (300,100) and (500,100).
  - Pin's x bounds are x=295 and x=505 due to line's width (as coded).
  - Attribute should be shifted by (-50,0), taking the left side as the
reference point (x=295).
  - Attribute position would be 245 (=295-50).

Hope this helps,

Carlos
 

El dom, 03-02-2008 a las 22:18 +0200, Timur Aydin escribió:
> Hi,
> 
> According to the default-position-of-text-attributes list in
> default-attrib-positions.scm, when a pin is placed to the right side of
> the symbol box, the pinlabel attribute should be shifted by (-50, 0)
> points. However, after placing the pin, I am seeing that the actual
> shift is (-55, 0). I am wondering where the extra 5 points is coming
> from. I don't know if this is by design or if this is a bug, so I
> wanted to ask first. To duplicate:
> 
> - Create a new symbol file:
> 
> $ gschem xxx.sym
> 
> - Place an outline box
> - Place a pin to the right side of the box
> - Set the snap grid spacing to 5 and zoom in to the pinlabel attribute.
> - Confirm that the attribute is 55 points to the left of the pin.
> 



_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev

Reply via email to