~ubuntu-branches/ubuntu/utopic/inkscape/utopic-proposed

« back to all changes in this revision

Viewing changes to share/extensions/dxf_outlines.py

  • Committer: Package Import Robot
  • Author(s): Alex Valavanis
  • Date: 2014-08-19 19:10:32 UTC
  • mfrom: (1.6.5) (2.5.14 sid)
  • Revision ID: package-import@ubuntu.com-20140819191032-2eca1qihaszjk9i6
Tags: 0.48.5-2ubuntu1
* Merge with Debian Unstable (LP: #1358863). Fixes several Ubuntu bugs:
  - Illustrator CS SVG won't load: namespace URIs in entities (LP: #166371)
  - inkscape crashed with SIGSEGV in
    sp_dtw_color_profile_event() (LP: #966441)
  - inkscape crashed with SIGSEGV (LP: #1051017)
  - inkscape crashed with SIGSEGV in Inkscape::Preferences::_getNode()
    (LP: #1163241)
  - save a copy reverts to save as (LP: #529843)
  - Extension to braille not working on Xubuntu 12.10 (LP: #1090865)
* Remaining changes:
  - debian/control:
    + Set Ubuntu Developer as maintainer,
    + build-depend on dh-translation to handle Ubuntu translation,
    + demote pstoedit from Recommends to Suggests (because it's in universe),
  - debian/patches/0006_add_unity_quicklist_support.patch: add.
  - debian/patches/series: update.
  - debian/rules:
    + add dh_translation to handle Ubuntu translation
* Drop debian/patches/librevenge.patch (superseded by
    debian/patches/0006-Update_to_new_libwpg.patch)

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
            self.poly = [csp[0]]                            # initiallize new polyline
89
89
            self.color_LWPOLY = self.color
90
90
            self.layer_LWPOLY = self.layer
 
91
            self.closed_LWPOLY = self.closed
91
92
        self.poly.append(csp[1])
92
93
    def LWPOLY_output(self):
93
94
        if len(self.poly) == 1:
94
95
            return
95
96
        self.handle += 1
96
 
        self.dxf_add("  0\nLWPOLYLINE\n  5\n%x\n100\nAcDbEntity\n  8\n%s\n 62\n%d\n100\nAcDbPolyline\n 90\n%d\n 70\n0\n" % (self.handle, self.layer_LWPOLY, self.color_LWPOLY, len(self.poly)))
 
97
        self.dxf_add("  0\nLWPOLYLINE\n  5\n%x\n100\nAcDbEntity\n  8\n%s\n 62\n%d\n100\nAcDbPolyline\n 90\n%d\n 70\n%d\n" % (self.handle, self.layer_LWPOLY, self.color_LWPOLY, len(self.poly), self.closed_LWPOLY))
97
98
        for i in range(len(self.poly)):
98
99
            self.dxf_add(" 10\n%f\n 20\n%f\n 30\n0.0\n" % (self.poly[i][0],self.poly[i][1]))
99
100
    def dxf_spline(self,csp):
169
170
                if style['stroke'] and style['stroke'] != 'none' and style['stroke'][0:3] != 'url':
170
171
                    rgb = simplestyle.parseColor(style['stroke'])
171
172
        hsl = coloreffect.ColorEffect.rgb_to_hsl(coloreffect.ColorEffect(),rgb[0]/255.0,rgb[1]/255.0,rgb[2]/255.0)
 
173
        self.closed = 0                                 # only for LWPOLYLINE
172
174
        self.color = 7                                  # default is black
173
175
        if hsl[2]:
174
176
            self.color = 1 + (int(6*hsl[0] + 0.5) % 6)  # use 6 hues
176
178
            d = node.get('d')
177
179
            if not d:
178
180
                return
 
181
            if (d[-1] == 'z' or d[-1] == 'Z'):
 
182
                self.closed = 1
179
183
            p = cubicsuperpath.parsePath(d)
180
184
        elif node.tag == inkex.addNS('rect','svg'):
 
185
            self.closed = 1
181
186
            x = float(node.get('x'))
182
187
            y = float(node.get('y'))
183
188
            width = float(node.get('width'))