last-svn-commit-799-g257be9e Introduce new anchors.

* scribo/core/tag/anchor.hh: New anchors. * scribo/filter/internal/alignment_angle.hh, * scribo/primitive/link/internal/compute_anchor.hh: Make use of that new anchors. --- scribo/ChangeLog | 10 ++++++++++ scribo/scribo/core/tag/anchor.hh | 6 ++++-- scribo/scribo/filter/internal/alignment_angle.hh | 2 ++ .../primitive/link/internal/compute_anchor.hh | 16 ++++++++++++++-- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/scribo/ChangeLog b/scribo/ChangeLog index f0bff06..d28a95b 100644 --- a/scribo/ChangeLog +++ b/scribo/ChangeLog @@ -1,5 +1,15 @@ 2011-03-14 Guillaume Lazzara <z@lrde.epita.fr> + Introduce new anchors. + + * scribo/core/tag/anchor.hh: New anchors. + + * scribo/filter/internal/alignment_angle.hh, + * scribo/primitive/link/internal/compute_anchor.hh: Make use of + that new anchors. + +2011-03-14 Guillaume Lazzara <z@lrde.epita.fr> + Rename document serializer base class. * scribo/core/internal/doc_xml_serializer.hh: Rename as... diff --git a/scribo/scribo/core/tag/anchor.hh b/scribo/scribo/core/tag/anchor.hh index bb6780c..7ce8ddc 100644 --- a/scribo/scribo/core/tag/anchor.hh +++ b/scribo/scribo/core/tag/anchor.hh @@ -37,11 +37,13 @@ namespace scribo { MassCenter = 0, Top, + StrictTopCenter, Bottom, + StrictBottomCenter, Center, - ActualLeft, + StrictLeft, Left, - ActualRight, + StrictRight, Right, TopLeft, TopStrictLeft, diff --git a/scribo/scribo/filter/internal/alignment_angle.hh b/scribo/scribo/filter/internal/alignment_angle.hh index 33855a8..035dec7 100644 --- a/scribo/scribo/filter/internal/alignment_angle.hh +++ b/scribo/scribo/filter/internal/alignment_angle.hh @@ -109,6 +109,7 @@ namespace scribo break; // Top + case anchor::StrictTopCenter: case anchor::TopStrictLeft: case anchor::Top: { @@ -122,6 +123,7 @@ namespace scribo break; // Bottom + case anchor::StrictBottomCenter: case anchor::BottomStrictRight: case anchor::Bottom: { diff --git a/scribo/scribo/primitive/link/internal/compute_anchor.hh b/scribo/scribo/primitive/link/internal/compute_anchor.hh index c1a9106..9afc33f 100644 --- a/scribo/scribo/primitive/link/internal/compute_anchor.hh +++ b/scribo/scribo/primitive/link/internal/compute_anchor.hh @@ -111,6 +111,12 @@ namespace scribo break; + // Bounding box Strict top center + case anchor::StrictTopCenter: + sp.row() = components(current_object).bbox().pmin().row(); + break; + + // Bounding box top left case anchor::TopStrictLeft: sp.col() = components(current_object).bbox().pmin().col(); @@ -138,13 +144,19 @@ namespace scribo break; + // Bounding box strict bottom center. + case anchor::StrictBottomCenter: + sp.row() = components(current_object).bbox().pmax().row(); + break; + + // Bounding box center case anchor::Center: return components(current_object).bbox().pcenter(); // Bounding box actual left center - case anchor::ActualLeft: + case anchor::StrictLeft: return P(components(current_object).bbox().pcenter().row(), components(current_object).bbox().pmin().col()); @@ -161,7 +173,7 @@ namespace scribo // Bounding box actual right center - case anchor::ActualRight: + case anchor::StrictRight: return P(components(current_object).bbox().pcenter().row(), components(current_object).bbox().pmax().col()); -- 1.5.6.5
participants (1)
-
Guillaume Lazzara