+ initialize x,y for close_path commands
This commit is contained in:
parent
1b3b598b80
commit
21c618ccc5
1 changed files with 235 additions and 221 deletions
18
deps/agg/include/agg_conv_clipper.h
vendored
18
deps/agg/include/agg_conv_clipper.h
vendored
|
@ -48,6 +48,8 @@ namespace agg
|
|||
ClipperLib::Clipper m_clipper;
|
||||
clipper_PolyFillType m_subjFillType;
|
||||
clipper_PolyFillType m_clipFillType;
|
||||
double start_x_;
|
||||
double start_y_;
|
||||
|
||||
int Round(double val)
|
||||
{
|
||||
|
@ -67,7 +69,9 @@ namespace agg
|
|||
m_contour(-1),
|
||||
m_operation(op),
|
||||
m_subjFillType(subjFillType),
|
||||
m_clipFillType(clipFillType)
|
||||
m_clipFillType(clipFillType),
|
||||
start_x_(0),
|
||||
start_y_(0)
|
||||
{
|
||||
m_scaling_factor = std::max(std::min(scaling_factor, 6),0);
|
||||
m_scaling_factor = Round(std::pow((double)10, m_scaling_factor));
|
||||
|
@ -84,7 +88,9 @@ namespace agg
|
|||
m_contour(-1),
|
||||
m_operation(op),
|
||||
m_subjFillType(subjFillType),
|
||||
m_clipFillType(clipFillType)
|
||||
m_clipFillType(clipFillType),
|
||||
start_x_(0),
|
||||
start_y_(0)
|
||||
{
|
||||
m_scaling_factor = std::max(std::min(scaling_factor, 6),0);
|
||||
m_scaling_factor = Round(std::pow((double)10, m_scaling_factor));
|
||||
|
@ -271,6 +277,8 @@ namespace agg
|
|||
}
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
template<class VSA, class VSB>
|
||||
unsigned conv_clipper<VSA, VSB>::vertex(double *x, double *y)
|
||||
{
|
||||
|
@ -281,10 +289,14 @@ namespace agg
|
|||
if( next_vertex( x, y ) )
|
||||
{
|
||||
m_status =status_line_to;
|
||||
start_x_ = *x;
|
||||
start_y_ = *y;
|
||||
return path_cmd_move_to;
|
||||
}
|
||||
else
|
||||
{
|
||||
*x = start_x_;
|
||||
*y = start_y_;
|
||||
m_status = status_stop;
|
||||
return path_cmd_end_poly | path_flags_close;
|
||||
}
|
||||
|
@ -301,6 +313,8 @@ namespace agg
|
|||
else
|
||||
{
|
||||
m_status = status_move_to;
|
||||
*x = start_x_;
|
||||
*y = start_y_;
|
||||
return path_cmd_end_poly | path_flags_close;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue