kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #18694
Re: LIB_TEXT bounding boxes
Le 17/06/2015 00:11, Chris Pavlina a écrit :
> Hi all,
>
> While working on that field autoplace feature, I noticed that
> LIB_PART::GetBodyBoundingBox was returning incorrect bounding boxes when
> the parts contained a LIB_TEXT. Further investigation revealed that
> there was an extra negation of the vertical dimension somewhere in the
> mix. The trouble is, there appear to be multiple of these, because
> adding or removing negations would fix it in this place, but would cause
> other troubles (text rendering in the wrong spot in libedit, or clicks
> not being received). The only way I found that worked was to
> special-case LIB_TEXT inside LIB_PART::GetBodyBoundingBox, negating both
> the Y position and Y size. Ugly hack attached.
>
> Anyone familiar enough to have a guess as to what the "real" problem is,
> without me spending hours digging into the entirety of the bounding box
> code? The ugly hack works, but... ew.
>
> --
> Chris
For historical reasons, the Y axis is bottom to top for coordinates of
symbols (graphic items, texts ..) in libraries, and is top to bottom in
schematic.
When drawing a symbol, a matrix transform is applied to coordinates, to
take in account the Y axis orientation, as well as component orientation
(rotation, mirroring).
--
Jean-Pierre CHARRAS
Follow ups
References