This commit is contained in:
@@ -741,32 +741,41 @@ class svgHandler(xml.sax.ContentHandler):
|
||||
else:
|
||||
self.svgdpi = 96.0
|
||||
if 'inkscape:version' not in data:
|
||||
_inf = ("This SVG file does not appear to have been produced "
|
||||
"by Inkscape. If it does not contain absolute units "
|
||||
"then a DPI setting will be used.")
|
||||
_qst = ("Do you wish to use 96 dpi? Choosing 'No' "
|
||||
"will use the older standard 90 dpi.")
|
||||
if FreeCAD.GuiUp:
|
||||
msgBox = QtGui.QMessageBox()
|
||||
msgBox.setText(translate("ImportSVG", _inf))
|
||||
msgBox.setInformativeText(translate("ImportSVG", _qst))
|
||||
msgBox.setStandardButtons(QtGui.QMessageBox.Yes
|
||||
| QtGui.QMessageBox.No)
|
||||
msgBox.setDefaultButton(QtGui.QMessageBox.No)
|
||||
ret = msgBox.exec_()
|
||||
if ret == QtGui.QMessageBox.Yes:
|
||||
self.svgdpi = 96.0
|
||||
else:
|
||||
self.svgdpi = 90.0
|
||||
if ret:
|
||||
_msg(translate("ImportSVG", _inf))
|
||||
_msg(translate("ImportSVG", _qst))
|
||||
_msg("*** User specified {} "
|
||||
"dpi ***".format(self.svgdpi))
|
||||
else:
|
||||
# exact scaling is calculated later below. Here we just want
|
||||
# to skip the DPI dialog if a unit is specified in the viewbox
|
||||
if "width" in data and "mm" in attrs.getValue('width'):
|
||||
self.svgdpi = 96.0
|
||||
_msg(_inf)
|
||||
_msg("*** Assuming {} dpi ***".format(self.svgdpi))
|
||||
elif "width" in data and "in" in attrs.getValue('width'):
|
||||
self.svgdpi = 96.0
|
||||
elif "width" in data and "cm" in attrs.getValue('width'):
|
||||
self.svgdpi = 96.0
|
||||
else:
|
||||
_inf = ("This SVG file does not appear to have been produced "
|
||||
"by Inkscape. If it does not contain absolute units "
|
||||
"then a DPI setting will be used.")
|
||||
_qst = ("Do you wish to use 96 dpi? Choosing 'No' "
|
||||
"will use the older standard 90 dpi.")
|
||||
if FreeCAD.GuiUp:
|
||||
msgBox = QtGui.QMessageBox()
|
||||
msgBox.setText(translate("ImportSVG", _inf))
|
||||
msgBox.setInformativeText(translate("ImportSVG", _qst))
|
||||
msgBox.setStandardButtons(QtGui.QMessageBox.Yes
|
||||
| QtGui.QMessageBox.No)
|
||||
msgBox.setDefaultButton(QtGui.QMessageBox.No)
|
||||
ret = msgBox.exec_()
|
||||
if ret == QtGui.QMessageBox.Yes:
|
||||
self.svgdpi = 96.0
|
||||
else:
|
||||
self.svgdpi = 90.0
|
||||
if ret:
|
||||
_msg(translate("ImportSVG", _inf))
|
||||
_msg(translate("ImportSVG", _qst))
|
||||
_msg("*** User specified {} "
|
||||
"dpi ***".format(self.svgdpi))
|
||||
else:
|
||||
self.svgdpi = 96.0
|
||||
_msg(_inf)
|
||||
_msg("*** Assuming {} dpi ***".format(self.svgdpi))
|
||||
if self.svgdpi == 1.0:
|
||||
_wrn("This SVG file (" + inks_doc_name + ") "
|
||||
"has an unrecognised format which means "
|
||||
|
||||
Reference in New Issue
Block a user