tdf#84507 move contour text to correct place in rotated...
commit47664e282da4999b8e471a6a916d7ec80414ac18
authorRegina Henschel <rb.henschel@t-online.de>
Tue, 7 May 2024 21:51:24 +0000 (7 23:51 +0200)
committerRegina Henschel <rb.henschel@t-online.de>
Mon, 13 May 2024 22:25:13 +0000 (14 00:25 +0200)
treed792f47777182f04fd620c23ceac62c2528f00a8
parent5265c69ed6aa2a5f88cf939c64683552e587e575
tdf#84507 move contour text to correct place in rotated...

...path objects.

I first tried to change the UnitPolyPolygon in
ViewContactOfSdrPathObj::createViewIndependentPrimitive2DSequence().
But it is needed in that way to draw the geometry of the object.
Now the change is made in SdrTextObj::impDecomposeContourTextPrimitive().

The basic idea is to recover the original PolyPolygon and transform it so,
that the transformed text is placed into the transformed PolyPolygon. The
ObjectMatrix gets a translation then, which moves the transformed text to
the correct position in the PolyPolygon.

For East Asian writingmode tb-rl, the text start needs to be top-right.
Added that, which resolves bug 128433.

If the shape has a fat stroke the text reaches into the stroke currently.
I have changed the code so that now a reduced area for the text is used.
The polypolygon behaves now same as the legacy rectangle.

Sometimes not all text is drawn although the rotated PolyPolygon would
have enought place for it. Or in other cases the text spills out of the
PolyPolygon. But I don't know a solution yet. As the other changes are
an improvement, this problem can be solved later.

Change-Id: I951024bf0d6d992587ec9cf2ed37665f322b66fb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167299
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
svx/qa/unit/data/tdf128433_rectanglecontourtext_CJK.fodg [new file with mode: 0644]
svx/qa/unit/data/tdf84507_polygoncontourtext.fodg [new file with mode: 0644]
svx/qa/unit/svdraw.cxx
svx/source/svdraw/svdotextdecomposition.cxx