Bugfix in Draft custom hatch patterns
This commit is contained in:
parent
983e2b44de
commit
985b7da5b3
|
@ -50,9 +50,10 @@ FreeCAD.svgpatterns = importSVG.getContents(Draft_rc.qt_resource_data,'pattern',
|
||||||
altpat = Draft.getParam("patternFile")
|
altpat = Draft.getParam("patternFile")
|
||||||
if os.path.isdir(altpat):
|
if os.path.isdir(altpat):
|
||||||
for f in os.listdir(altpat):
|
for f in os.listdir(altpat):
|
||||||
if '.svg' in f:
|
if f[-4:].upper() == ".SVG":
|
||||||
p = importSVG.getContents(altpat+os.sep+f,'pattern')
|
p = importSVG.getContents(altpat+os.sep+f,'pattern')
|
||||||
if p: FreeCAD.svgpatterns[p[0]]=p[1]
|
if p:
|
||||||
|
FreeCAD.svgpatterns.update(p)
|
||||||
|
|
||||||
# sets the default working plane
|
# sets the default working plane
|
||||||
plane = WorkingPlane.plane()
|
plane = WorkingPlane.plane()
|
||||||
|
|
|
@ -896,8 +896,7 @@ def getContents(filename,tag,stringmode=False):
|
||||||
contents = filename
|
contents = filename
|
||||||
else:
|
else:
|
||||||
f = pythonopen(filename)
|
f = pythonopen(filename)
|
||||||
contents = ''
|
contents = f.read()
|
||||||
for line in f: contents += line
|
|
||||||
f.close()
|
f.close()
|
||||||
contents = contents.replace('\n','_linebreak')
|
contents = contents.replace('\n','_linebreak')
|
||||||
searchpat = '<'+tag+'.*?</'+tag+'>'
|
searchpat = '<'+tag+'.*?</'+tag+'>'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user