1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <basegfx/tools/tools.hxx>
11 #include <basegfx/matrix/b2dhommatrix.hxx>
12 #include <basegfx/polygon/b2dpolypolygon.hxx>
13 #include <basegfx/polygon/b2dpolypolygontools.hxx>
15 #include <rtl/ustrbuf.hxx>
16 #include <rtl/math.hxx>
20 namespace basegfx
{ namespace tools
22 B2DPolyPolygon
number2PolyPolygon(double fValue
, sal_Int32 nTotalDigits
, sal_Int32 nDecPlaces
, bool bLitSegments
)
26 const double fSpace
=0.2;
30 rtl::OUStringBuffer aNum
;
31 rtl::math::doubleToUStringBuffer(aNum
,
33 rtl_math_StringFormat_F
,
39 double fCurrX
=std::max(nTotalDigits
-aNum
.getLength(),
40 sal_Int32(0)) * (1.0+fSpace
);
41 for( sal_Int32 i
=0; i
<aNum
.getLength(); ++i
)
44 aCurr
=createSevenSegmentPolyPolygon(aNum
[i
],
48 aMat
.translate(fCurrX
,0.0);
49 aCurr
.transform(aMat
);
61 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */