Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CursorTool issue with LogMapper #803

Merged
merged 8 commits into from
Jul 7, 2021
2 changes: 1 addition & 1 deletion chaco/plots/lineplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def hittest(self, screen_pt, threshold=7.0, return_distance=False):
# screen_pt is one of the points in the lineplot
data_pt = (self.index.get_data()[ndx], self.value.get_data()[ndx])
if return_distance:
scrn_pt = self.map_screen(data_pt)
scrn_pt = self.map_screen(data_pt)[0]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note this change is also made in #802

Both the changes to BaseXYPlot1.map_screen done there and LinearMapper.map_screen here can cause the return type to be an an array of shape (N,2).

dist = sqrt(
(screen_pt[0] - scrn_pt[0]) ** 2
+ (screen_pt[1] - scrn_pt[1]) ** 2
Expand Down