Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified lib/matplotlib/tests/baseline_images/test_axes/marker_edges.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lib/matplotlib/tests/baseline_images/test_text/text_contains.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/_backend_agg.h
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ inline void RendererAgg::draw_markers(GCAgg &gc,

// Deal with the difference in y-axis direction
marker_trans *= agg::trans_affine_scaling(1.0, -1.0);

trans *= agg::trans_affine_scaling(1.0, -1.0);
trans *= agg::trans_affine_translation(0.5, (double)height + 0.5);

Expand All @@ -527,6 +528,13 @@ inline void RendererAgg::draw_markers(GCAgg &gc,
points_to_pixels(gc.linewidth));
curve_t marker_path_curve(marker_path_snapped);

if (!marker_path_snapped.is_snapping()) {
// If the path snapper isn't in effect, at least make sure the marker
// at (0, 0) is in the center of a pixel. This, importantly, makes
// the circle markers look centered around the point they refer to.
marker_trans *= agg::trans_affine_translation(0.5, 0.5);
}

transformed_path_t path_transformed(path, trans);
nan_removed_t path_nan_removed(path_transformed, false, false);
snap_t path_snapped(path_nan_removed, SNAP_FALSE, path.total_vertices(), 0.0);
Expand Down