Skip to content

Allow scaling in agg's draw_marker_at_points#594

Merged
jwiggins merged 1 commit into
masterfrom
fix/kiva-marker-points-scaling
Feb 19, 2021
Merged

Allow scaling in agg's draw_marker_at_points#594
jwiggins merged 1 commit into
masterfrom
fix/kiva-marker-points-scaling

Conversation

@jwiggins
Copy link
Copy Markdown
Member

This will be need to keep Chaco's colormapped scatterplot renderer working if #591 is merged.

Comment on lines +1192 to +1196
mx = pts[i];
my = pts[i+1];
ctm.transform(&mx, &my);
// XXX: Assuming scale is uniform in both directions
m.marker(int(mx), int(my), size * sx, type);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not entirely sure how this change works.

Previously, we were storing the translation in x and y as tx and ty - and then adding markers at pts[i]+tx and pts[i+1]+ty.

Now, we're storing the scale information in sx and sy, transforming the context manager by pts[i] and pts[i+1] and then also add markers at pts[i] and pts[i+1]?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctm is the "current transformation matrix". We're applying it to (mx, my), which the position of the current marker. Then we're calling the marker method on the marker renderer to render a marker at the position (mx, my) and scaling its size by sx.

@jwiggins
Copy link
Copy Markdown
Member Author

Thanks for the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants