https://issues.apache.org/ooo/show_bug.cgi?id=121382

--- Comment #6 from Armin Le Grand <[email protected]> ---
ALG: I see. But then the problem is 

        double fWidth = rSz.Width() * maXForm.eM11;
        double fHeight = rSz.Height() * maXForm.eM22;


inside Size WinMtfOutput::ImplMap( const Size& rSz )
Were (in contrast) Point WinMtfOutput::ImplMap( const Point& rPt ) contains the
whole matrix multiplication:

        fX2 = fX * maXForm.eM11 + fY * maXForm.eM21 + maXForm.eDx;
        fY2 = fX * maXForm.eM12 + fY * maXForm.eM22 + maXForm.eDy;

Thus, the reason that width *and* height are zero is that someone had optimized
that matrix multiplication in ImplMap for Size. When bringing this back to it's
regular form (which should be)

        double fWidth = rSz.Width() * maXForm.eM11 + rSz.Height() *
maXForm.eM21;
        double fHeight = rSz.Height() * maXForm.eM22 + rSz.Width() *
maXForm.eM22;

The calls to WinMtfOutput::ImplMap( const Size& rSz ) would execute the normal
rotation as part of the linear matrix multiplication. Thus, in 90/270 degree
rotation case, the Height returned should be nonzero and is the searched value.

This would generally fix the WinMtfOutput::ImplMap( const Size& rSz ) method,
for *all* kinds of transformations coming along. As consequence indeed the
length (metric) should be calculated in WinMtfOutput::DrawText as follows:

            const Size aTransformedSize(ImplMap(Size(pDXArry[i], 0)));
            const sal_Int32 nTemp(
                basegfx::fround(
                    sqrt(
                        aTransformedSize.Width() * aTransformedSize.Width() + 
                        aTransformedSize.Height() *
aTransformedSize.Height())));

Then, all this would work with arbitrary transformations.
HTH!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.

Reply via email to