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

Add circle draw shape #885

Closed
ivmartel opened this issue Mar 1, 2021 · 4 comments
Closed

Add circle draw shape #885

ivmartel opened this issue Mar 1, 2021 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@ivmartel
Copy link
Owner

ivmartel commented Mar 1, 2021

The draw tool must be able to draw circle shapes.

@ivmartel ivmartel added the enhancement New feature or request label Mar 1, 2021
@ivmartel ivmartel added this to the 0.29.0 milestone Mar 1, 2021
@yashsharma16
Copy link

Hello, I am trying to add shapes, circles, and rectangles in the draw part, how can I implement dwv.math.Circle

@ivmartel
Copy link
Owner Author

ivmartel commented Dec 9, 2021

Check out the examples, there is one with draw: https://jsfiddle.net/ivmartel/fugw49be/ (change the draw option to be Circle)

@yashsharma16
Copy link

yashsharma16 commented Dec 10, 2021

Thanks for replying its working, but I have 1 more question I want to add multiple options in the top bar, like currently from your previous example I have Draw, WindowLevel, and ZoomAndPan, I tried adding Circle, rectangle in array but it's not working

like this:

Draw: {
  options: ['Ruler','Circle','Rectangle'],//it should come as a option for more shapes-edit
  type: 'factory',
  events: ['drawcreate', 'drawchange', 'drawmove', 'drawdelete']
}

and on

 // activate tool once done loading
app.addEventListener('load', function () {
  app.setTool('Draw');
  app.setDrawShape(tools.Draw.options[0]);
});

I want to add an event based on the option selected by the user from the top menu,(onChangeTool = (tool: string) => {}))
please guide me on this also,

@ivmartel
Copy link
Owner Author

You need to add a select for the draw shape, when clicked, you can call setDrawShape with the selected shape.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants