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")
|
||||
if os.path.isdir(altpat):
|
||||
for f in os.listdir(altpat):
|
||||
if '.svg' in f:
|
||||
if f[-4:].upper() == ".SVG":
|
||||
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
|
||||
plane = WorkingPlane.plane()
|
||||
|
|
|
@ -896,8 +896,7 @@ def getContents(filename,tag,stringmode=False):
|
|||
contents = filename
|
||||
else:
|
||||
f = pythonopen(filename)
|
||||
contents = ''
|
||||
for line in f: contents += line
|
||||
contents = f.read()
|
||||
f.close()
|
||||
contents = contents.replace('\n','_linebreak')
|
||||
searchpat = '<'+tag+'.*?</'+tag+'>'
|
||||
|
|
Loading…
Reference in New Issue
Block a user