Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 632e4e3

Browse files
committed
Fix bug where the interpolation endpoint was one step further than correct
1 parent e2f1a5f commit 632e4e3

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

extern/agg24-svn/include/agg_span_interpolator_linear.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ namespace agg
5353
//----------------------------------------------------------------
5454
void begin(double x, double y, unsigned len)
5555
{
56+
#ifdef MPL_FIX_AGG_INTERPOLATION_ENDPOINT_BUG
57+
len -= 1;
58+
#endif
59+
5660
double tx;
5761
double ty;
5862

@@ -75,6 +79,10 @@ namespace agg
7579
//----------------------------------------------------------------
7680
void resynchronize(double xe, double ye, unsigned len)
7781
{
82+
#ifdef MPL_FIX_AGG_INTERPOLATION_ENDPOINT_BUG
83+
len -= 1;
84+
#endif
85+
7886
m_trans->transform(&xe, &ye);
7987
m_li_x = dda2_line_interpolator(m_li_x.y(), iround(xe * subpixel_scale), len);
8088
m_li_y = dda2_line_interpolator(m_li_y.y(), iround(ye * subpixel_scale), len);

meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ project(
3333

3434
# Enable bug fixes in Agg
3535
add_project_arguments('-DMPL_FIX_AGG_IMAGE_FILTER_LUT_BUGS', language : 'cpp')
36+
add_project_arguments('-DMPL_FIX_AGG_INTERPOLATION_ENDPOINT_BUG', language : 'cpp')
3637

3738
cc = meson.get_compiler('c')
3839
cpp = meson.get_compiler('cpp')

0 commit comments

Comments
 (0)