Skip to content

Basecore2d GraphicsContexts starts subpaths when it shouldn't #986

@corranwebster

Description

@corranwebster

This causes issues like the following in the benchmarks (SVG backend):
image

The shape should look more like:
image

The cause would seem to be that the get_subpath_points function doesn't correctly handle situations where multiple points are added at once in an array after the first point:

enable/kiva/basecore2d.py

Lines 1240 to 1256 in 7ba4c71

def get_subpath_points(self, debug=0):
""" Gets the points that are in the current path.
The first entry in the draw_points list may actually
be an array. If this is true, the other points are
converted to an array and concatenated with the first
"""
if self.draw_points and len(shape(self.draw_points[0])) > 1:
first_points = self.draw_points[0]
other_points = asarray(self.draw_points[1:])
if len(other_points):
pts = concatenate((first_points, other_points), 0)
else:
pts = first_points
else:
pts = asarray(self.draw_points)
return pts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions