Simplify a bit
SVG diagonal percentage distances are defined in terms of viewBox diagonal length divided by sqrt(2) (normalized). See https://svgwg.org/svg2-draft/coords.html#Units Change-Id: I0d2101315d5f6c3333d021251eff17f6c13e804f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175991 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins
This commit is contained in:
parent
35b3abf583
commit
962bd03938
1 changed files with 2 additions and 6 deletions
|
@ -107,12 +107,8 @@ double SvgNumber::solve(const InfoProvider& rInfoProvider, NumberType aNumberTyp
|
||||||
else // length
|
else // length
|
||||||
{
|
{
|
||||||
// it's a length, relative to sqrt((w^2 + h^2)/2)
|
// it's a length, relative to sqrt((w^2 + h^2)/2)
|
||||||
const double fCurrentWidth(aViewPort.getWidth());
|
const double fDiagLength(std::hypot(aViewPort.getWidth(), aViewPort.getHeight()));
|
||||||
const double fCurrentHeight(aViewPort.getHeight());
|
fRetval *= fDiagLength / M_SQRT2;
|
||||||
const double fCurrentLength(
|
|
||||||
sqrt((fCurrentWidth * fCurrentWidth + fCurrentHeight * fCurrentHeight)/2.0));
|
|
||||||
|
|
||||||
fRetval *= fCurrentLength;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue