wrong transformation ( from accidently removed viewBox ) in svg2qvg
fixed. qvg files recreated
This commit is contained in:
parent
e8db2581f4
commit
2236e44686
5
LICENSES
5
LICENSES
@ -24,3 +24,8 @@ c) Material3 Icons
|
|||||||
|
|
||||||
Code: https://github.com/marella/material-design-icons
|
Code: https://github.com/marella/material-design-icons
|
||||||
SPDX-License-Identifier: Apache License 2.0
|
SPDX-License-Identifier: Apache License 2.0
|
||||||
|
|
||||||
|
d) Fluent2 Icons
|
||||||
|
|
||||||
|
Code: https://github.com/microsoft/fluentui-system-icons
|
||||||
|
SPDX-License-Identifier: MIT License
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -25,6 +25,22 @@ static void usage( const char* appName )
|
|||||||
qWarning() << "usage: " << appName << "svgfile qvgfile";
|
qWarning() << "usage: " << appName << "svgfile qvgfile";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static QRectF viewBox( QSvgRenderer& renderer )
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
QSvgRenderer::viewBoxF() returns a bounding box when no viewBox
|
||||||
|
has been defined. So we clear the viewBox and compare the result with
|
||||||
|
the initial value - assuming, that there was a viewBox when they differ.
|
||||||
|
*/
|
||||||
|
const auto viewBox = renderer.viewBoxF();
|
||||||
|
|
||||||
|
renderer.setViewBox( QRectF() );
|
||||||
|
const bool hasViewBox = ( viewBox != renderer.viewBoxF() );
|
||||||
|
renderer.setViewBox( viewBox );
|
||||||
|
|
||||||
|
return hasViewBox ? viewBox : QRectF( 0.0, 0.0, -1.0, -1.0 );
|
||||||
|
}
|
||||||
|
|
||||||
int main( int argc, char* argv[] )
|
int main( int argc, char* argv[] )
|
||||||
{
|
{
|
||||||
if ( argc != 3 )
|
if ( argc != 3 )
|
||||||
@ -56,21 +72,7 @@ int main( int argc, char* argv[] )
|
|||||||
return -2;
|
return -2;
|
||||||
|
|
||||||
QskGraphic graphic;
|
QskGraphic graphic;
|
||||||
|
graphic.setViewBox( ::viewBox( renderer ) );
|
||||||
{
|
|
||||||
/*
|
|
||||||
QSvgRenderer::viewBoxF() returns a bounding box when no viewBox
|
|
||||||
has been defined. So we clear the viewBox and compare the result with
|
|
||||||
the initial value - assuming, that there was a viewBox when they differ.
|
|
||||||
|
|
||||||
*/
|
|
||||||
const auto viewBox = renderer.viewBoxF();
|
|
||||||
renderer.setViewBox( QRectF() );
|
|
||||||
|
|
||||||
if ( viewBox != renderer.viewBoxF() )
|
|
||||||
graphic.setViewBox( viewBox );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QPainter painter( &graphic );
|
QPainter painter( &graphic );
|
||||||
renderer.render( &painter );
|
renderer.render( &painter );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user