cornerstoneTools
cornerstoneTools copied to clipboard
Can't override the svgCusor
Prerequisites
- [Y] Which version are you using? (Is it latest?)
- [Y] Are you reporting to the correct repository?
- [Y] Did you search existing issues? (Were any related?)
Description
Can't override the svgCusor of tool.
Steps to Reproduce the issue
- Set showSVGCursors to "true"
cornerstoneTools.init({
showSVGCursors: true
});
- create a custom svg cursor:
var MouseCursor = cornerstoneTools.importInternal("tools/cursors/MouseCursor");
var _wwwcCursor = new MouseCursor(
'<path fill="#FFFFFF" d="M200,0C89.1,0,0,89.1,0,200c0,110.9,89.1,200,200,200c110.9,0,200-89.1,200-200C400,89.1,310.9,0,200,0L200,0z M200,381.8V18.2c100,0,181.8,81.8,181.8,181.8S300,381.8,200,381.8L200,381.8z"/>',
{ viewBox: { x: 400, y: 400 } }
);
- override old svg cursor:
cornerstoneTools.addTool(cornerstoneTools.WwwcTool, { svgCursor: _wwwcCursor });
Expected behavior: (What you expected to happen) Show new svg cursor when active wwwc tool.
Actual behavior: (What actually happened) Throw error: svgCursor.getIconWithPointerSVG is not a function
CodeSandbox With Reproduction of Issue:
it looks like utils deepmerge func miss clone proto func.
Has this issue been fixed? The new cornerstone does not support the code from the sandbox at all. I am now stuck with the questions:
- How to override the cursor for an existing tool?
- How to set the cursor for a new custom tool?