272,7 → 272,7 |
bool ret = false; |
SvgStyle *gc = new SvgStyle; |
QDomElement docElem = inpdoc.documentElement(); |
QSize wh = parseWidthHeight(docElem); |
QSizeF wh = parseWidthHeight(docElem); |
double width = wh.width(); |
double height = wh.height(); |
if (!interactive || (flags & LoadSavePlugin::lfInsertPage)) |
319,7 → 319,7 |
if (points.size() > 3) |
{ |
QMatrix matrix; |
QSize wh2 = parseWidthHeight(docElem); |
QSizeF wh2 = parseWidthHeight(docElem); |
double w2 = wh2.width(); |
double h2 = wh2.height(); |
addGraphicContext(); |
745,9 → 745,9 |
return FPoint(x, y); |
} |
|
QSize SVGPlug::parseWidthHeight(const QDomElement &e) |
QSizeF SVGPlug::parseWidthHeight(const QDomElement &e) |
{ |
QSize size(550, 841); |
QSizeF size(550, 841); |
QString sw = e.attribute("width", "100%"); |
QString sh = e.attribute("height", "100%"); |
double w = 550, h = 841; |
757,7 → 757,7 |
h = sh.endsWith("%") ? fromPercentage(sh) : parseUnit(sh); |
if (!e.attribute("viewBox").isEmpty()) |
{ |
QRect viewBox = parseViewBox(e); |
QRectF viewBox = parseViewBox(e); |
double scw = (viewBox.width() > 0 && viewBox.height() > 0) ? viewBox.width() : size.width(); |
double sch = (viewBox.width() > 0 && viewBox.height() > 0) ? viewBox.height() : size.height(); |
w *= (sw.endsWith("%") ? scw : 1.0); |
775,14 → 775,14 |
w = w / m * 842; |
h = h / m * 842; |
} |
size.setWidth(qRound(w)); |
size.setHeight(qRound(h)); |
size.setWidth(w); |
size.setHeight(h); |
return size; |
} |
|
QRect SVGPlug::parseViewBox(const QDomElement &e) |
QRectF SVGPlug::parseViewBox(const QDomElement &e) |
{ |
QRect box(0, 0, 0, 0); |
QRectF box(0, 0, 0, 0); |
if ( !e.attribute( "viewBox" ).isEmpty() ) |
{ |
QString viewbox( e.attribute( "viewBox" ) ); |