Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it necessary to add toolSelectedCallback feature?

See original GitHub issue


  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you perform a cursory search?

For more information, see the CONTRIBUTING guide.


There is the method that pointNearTool and toolSelectedCallback that I can only select the tool by mousedown near the handle, but I want to select the tool by mousedown inner the measurement by the pointInnerTool setted by myself. So I changed the mouseDown.js:

  const annotationToolsWithPointInnerClick = activeAndPassiveTools.filter(
    tool => {
      const toolState = getToolState(element,;
      const isInnerPoint = 
        toolState && &&
        tool.pointInnerTool && =>
          tool.pointInnerTool(element, data, coords, 'mouse')
      return isInnerPoint;
  if (annotationToolsWithPointInnerClick.length > 0) {
    const firstToolInnerPoint = annotationToolsWithPointInnerClick[0];
    const toolState = getToolState(element,;
    const firstAnnotationInnerPoint = => 
      firstToolInnerPoint.pointInnerTool(element, data, coords)

    if (firstAnnotationInnerPoint && firstToolInnerPoint.innerSelectedCallback) {

I Have add my custom feature in my version(forked from the official), @dannyrb If you think it’s necessary to add it , I will create PR.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

xingbofengcommented, Jul 22, 2019

Just to play devil’s advocate, how would you intend to deal with the case of drawing one region inside the other in this pointInnerTool mode?

e.g.: giphy

As the passive functionality of the first ROI would grab the event and you would instead start moving the ROI.

@JamesAPetts I’m not consider this problem,now i just choose the first annotation of the array.I need to consider it.

Thanks for the suggestion of @dannyrb ,i will talk about this suggestion with our doctors, now i think it’s not necessary to add this feature, maybe.Thanks!

dannyrbcommented, Jul 12, 2019

It’s cool to see other people playing around in the listeners/dispatchers ^_^

Tools that implement pointNearTool are basically saying that, if this is true, I want to handle the incoming event, and I want to do it in the library standard way of dragging all handles (unless I’ve overridden the default behavior).

Do you see pointInnerTool being used for behavior other than dragging all annotation handles? Do you have any practical real world examples of different behavior we might want to use when this is true? Is this behavior that should be a default implementation for innerSelectedCallback on BaseAnnotationTool?

To me, the biggest questions/risks are:

  • pointInnerTool has a higher chance of multiple tools reporting back true
    • Improved concepts of annotations depth/layers so we can determine which tool should handle events
    • Pushing annotations up/down layers may require a new annotation::selected state
  • Should there be a default behavior? Or some canned strategies that can be set with flags?

CC: @JamesAPetts

Thanks for the suggestion, @xingbofeng! It’s really encouraging to get feedback and feature requests for this part of the library.

Read more comments on GitHub >

github_iconTop Results From Across the Web

API Docs - Cornerstone Tools
This function is a callback to be overwriten in order to provide the wanted feature modal, overlay, popup or any kind of interaction...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found