Skip to content

Commit 8a3569d

Browse files
tacaswellMeeseeksDev[bot]
authored andcommitted
Backport PR #10077: Use fuzzy comparison for stroke join determination.
1 parent d9d5289 commit 8a3569d

File tree

7 files changed

+11
-5
lines changed

7 files changed

+11
-5
lines changed

extern/agg24-svn/include/agg_math_stroke.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,8 @@ namespace agg
391391
vc.remove_all();
392392

393393
double cp = cross_product(v0.x, v0.y, v1.x, v1.y, v2.x, v2.y);
394-
if(cp != 0 && (cp > 0) == (m_width > 0))
394+
if ((cp > agg::vertex_dist_epsilon && m_width > 0) ||
395+
(cp < -agg::vertex_dist_epsilon && m_width < 0))
395396
{
396397
// Inner join
397398
//---------------
-4 Bytes
Loading
98 Bytes
Loading
88 Bytes
Loading
89 Bytes
Loading

lib/matplotlib/tests/test_streamplot.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
from __future__ import (absolute_import, division, print_function,
22
unicode_literals)
33

4+
import sys
5+
46
import numpy as np
57
from numpy.testing import assert_array_almost_equal
68
import matplotlib.pyplot as plt
79
from matplotlib.testing.decorators import image_comparison
810
import matplotlib.transforms as mtransforms
911

1012

13+
on_win = (sys.platform == 'win32')
14+
15+
1116
def velocity_field():
1217
Y, X = np.mgrid[-3:3:100j, -3:3:100j]
1318
U = -1 - X**2 + Y
@@ -35,8 +40,7 @@ def test_startpoints():
3540
plt.plot(start_x, start_y, 'ok')
3641

3742

38-
@image_comparison(baseline_images=['streamplot_colormap'],
39-
tol=0.002)
43+
@image_comparison(baseline_images=['streamplot_colormap'])
4044
def test_colormap():
4145
X, Y, U, V = velocity_field()
4246
plt.streamplot(X, Y, U, V, color=U, density=0.6, linewidth=2,
@@ -54,7 +58,8 @@ def test_linewidth():
5458
linewidth=lw)
5559

5660

57-
@image_comparison(baseline_images=['streamplot_masks_and_nans'])
61+
@image_comparison(baseline_images=['streamplot_masks_and_nans'],
62+
tol=0.04 if on_win else 0)
5863
def test_masks_and_nans():
5964
X, Y, U, V = velocity_field()
6065
mask = np.zeros(U.shape, dtype=bool)

lib/matplotlib/tests/test_triangulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ def z(x, y):
785785

786786

787787
@image_comparison(baseline_images=['tri_smooth_gradient'],
788-
extensions=['png'], remove_text=True, tol=0.035)
788+
extensions=['png'], remove_text=True, tol=0.092)
789789
def test_tri_smooth_gradient():
790790
# Image comparison based on example trigradient_demo.
791791

0 commit comments

Comments
 (0)