Skip to content

Commit

Permalink
Fix Path.add_path() (celiagg#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwiggins authored Mar 19, 2021
1 parent 7c98e13 commit 3a461fd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion celiagg/_vertex_source.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ cdef extern from "vertex_source.h":
void close()
void reset()
unsigned last_vertex(double* x, double* y)
void concat_path[T](T& vs, unsigned path_id)
void concat_path[T](T& vs)

void move_to(double x, double y)
void line_to(double x, double y)
Expand Down
2 changes: 1 addition & 1 deletion celiagg/ndarray_canvas.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ void ndarray_canvas<pixfmt_t>::_draw_text_vector(GlyphIterator& iterator,
{
if (action == GlyphIterator::k_StepActionDraw)
{
shape.concat_path(m_font_cache.manager().path_adaptor(), 0);
shape.concat_path(m_font_cache.manager().path_adaptor());
}
action = iterator.step();
}
Expand Down
4 changes: 2 additions & 2 deletions celiagg/vertex_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void PathSource::arc(double x, double y, double radius, double start_angle,
}

agg::bezier_arc _arc(x, y, radius, radius, start_angle, sweep_angle);
m_path.concat_path(_arc, 0);
m_path.concat_path(_arc);
}

void PathSource::arc_to(double x1, double y1, double x2, double y2, double radius)
Expand Down Expand Up @@ -169,7 +169,7 @@ void PathSource::cubic_to(double x_ctrl1, double y_ctrl1, double x_ctrl2,
void PathSource::ellipse(double cx, double cy, double rx, double ry)
{
agg::bezier_arc _arc(cx, cy, rx, ry, 0, M_PI + M_PI);
m_path.concat_path(_arc, 0);
m_path.concat_path(_arc);
m_path.close_polygon();
}

Expand Down
4 changes: 2 additions & 2 deletions celiagg/vertex_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ class PathSource : public VertexSource
unsigned last_vertex(double* x, double* y) const;

template<class VertexSource>
void concat_path(VertexSource& vs, unsigned path_id)
void concat_path(VertexSource& vs)
{
m_path.concat_path(vs, path_id);
m_path.concat_path(vs);
}

void move_to(double x, double y);
Expand Down
6 changes: 3 additions & 3 deletions celiagg/vertex_source.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ cdef class Path(VertexSource):
_vertex_source.PathSource* ths = <_vertex_source.PathSource*>self._this
_vertex_source.PathSource* other = <_vertex_source.PathSource*>cpy._this

other.concat_path[_vertex_source.PathSource](dereference(ths), 0)
other.concat_path[_vertex_source.PathSource](dereference(ths))
return cpy

def final_point(self):
Expand Down Expand Up @@ -168,8 +168,8 @@ cdef class Path(VertexSource):
of this path.
"""
cdef _vertex_source.PathSource* pth = <_vertex_source.PathSource*>self._this
cdef _vertex_source.PathSource* othr = <_vertex_source.PathSource*>self._this
pth.concat_path[_vertex_source.PathSource](dereference(othr), 0)
cdef _vertex_source.PathSource* othr = <_vertex_source.PathSource*>other._this
pth.concat_path[_vertex_source.PathSource](dereference(othr))

def move_to(self, double x, double y):
"""move_to(x, y)
Expand Down

0 comments on commit 3a461fd

Please sign in to comment.