Fixed bug #574 - Draft hatches

svg pattern definitions are now embedded inside the View objects,
since they don't need to be in the defs section.
This commit is contained in:
Yorik van Havre
2012-01-19 20:59:09 -02:00
parent 44b03785b7
commit 670a3cd9d2
2 changed files with 12 additions and 21 deletions

View File

@@ -3014,7 +3014,6 @@ class Drawing(Modifier):
self.page = self.createDefaultPage()
sel.reverse()
for obj in sel:
self.insertPattern(obj)
if obj.ViewObject.isVisible():
name = 'View'+obj.Name
oldobj = self.page.getObject(name)
@@ -3022,22 +3021,6 @@ class Drawing(Modifier):
Draft.makeDrawingView(obj,self.page)
self.doc.recompute()
def insertPattern(self,obj):
"inserts a pattern object on the page"
if 'FillStyle' in obj.ViewObject.PropertiesList:
if obj.ViewObject.FillStyle != 'shape color':
hatch = obj.ViewObject.FillStyle
vobj = self.page.getObject('Pattern'+hatch)
if not vobj:
if hatch in FreeCAD.svgpatterns:
view = self.doc.addObject('Drawing::FeatureView','Pattern'+hatch)
svg = FreeCAD.svgpatterns[hatch]
view.ViewResult = svg
view.X = 0
view.Y = 0
view.Scale = 1
self.page.addObject(view)
def createDefaultPage(self):
"created a default page"
template = Draft.getParam("template")