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

Tool.Clear is not working properly #30

Open
tar04 opened this issue Oct 20, 2023 · 34 comments
Open

Tool.Clear is not working properly #30

tar04 opened this issue Oct 20, 2023 · 34 comments

Comments

@tar04
Copy link

tar04 commented Oct 20, 2023

Hey there! I have an issue. Here is it: whem im getting my operations stored on backend theyre pasting to the drawboard properly but when im clearing it i can still choose deleted elements. How can i fix that?

@tar04
Copy link
Author

tar04 commented Oct 20, 2023

@dilidili

@tar04
Copy link
Author

tar04 commented Oct 24, 2023

I guess i have nice idea how to fix this. You just have to change file SelectTool.tsx a bit like this:

Function onSelectMouseDown now finding operation to select inside array of all operations. But you need to find operation inside array which consist of operations after clear operation was added. Theres code sample:

const lastClearIndex = operationListState.reduced.length - [...operationListState.reduced].reverse().findIndex(operation => operation.tool === Tool.Clear)

const paintedOperations = operationListState.reduced.slice(lastClearIndex);

let selectedItem: Operation | null = findSelectedItem(paintedOperations, pos, scale);

@mudasirpandith
Copy link

@tar04 I need help. Can i setup it in the nextjs or reactjs ?Please guide

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

@tar04 I need help. Can i setup it in the nextjs or reactjs ?Please guide

You need help with the issue or to setup whole lib?

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

@mudasirpandith

@mudasirpandith
Copy link

mudasirpandith commented Dec 22, 2023

@tar04 I want to use editor in my website. that`s setting lib

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

@tar04 I want to use editor in my website. that`s setting lib

Have you tried instructions from repository?

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

Or you have some specific problems?

@mudasirpandith
Copy link

mudasirpandith commented Dec 22, 2023

Or you have some specific problems?

I tried to use const DrawingBoard = require('react-drawing-board'); , but i am not able to do it.Showing some conflicts and bunch of error while installing it

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

@mudasirpandith what about es6 imports?

@mudasirpandith
Copy link

@mudasirpandith what about es6 imports?

It is not getting installed.

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

@mudasirpandith what about es6 imports?

It is not getting installed.

What you mean?) you have to install library and types for it if you’re using typescript

@mudasirpandith
Copy link

i was trying to use it in the React and using Js.
is this correct way to use install npm install react-drawing-board

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

i was trying to use it in the React and using Js. is this correct way to use install npm install react-drawing-board

Yes

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

And then you have to import it inside component you want to use it in

@mudasirpandith
Copy link

Screenshot 2023-12-22 183730
image
These are the errors it is showing

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

Screenshot 2023-12-22 183730 image These are the errors it is showing

Did you opened project folder in console?

@mudasirpandith
Copy link

Yes,i am installing in the right directory. Other npm gets installed in that

@mudasirpandith
Copy link

@tar04

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

What do you mean “other npm”? @mudasirpandith

@mudasirpandith
Copy link

What do you mean “other npm”? @mudasirpandith

i mean other packages get installed. Is there any way I can use this editor in my website?

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

@mudasirpandith You can use cdn server instead, just find the link with the lib and add script with it to your project

@mudasirpandith
Copy link

@mudasirpandith You can use cdn server instead, just find the link with the lib and add script with it to your project

can you help me out for this? please

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

@mudasirpandith sure. I’ll be home in 25 mins

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

Copy the script, paste in html document and then you should try to find component in window object

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

Btw what ide do u use?

@mudasirpandith
Copy link

Btw what ide do u use?

vscode

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

You can add the package in package.jam file by yourself and the ide should show you hint about uninstalled dependencies

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

@mudasirpandith

@mudasirpandith
Copy link

I am totally lost into this.
Can you please guide me step by step?

@mudasirpandith

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

I am totally lost into this. Can you please guide me step by step?

@mudasirpandith

Yup. Do you hame smth like discord? JUst to text you there

@mudasirpandith
Copy link

yeah, discord username :mudasirpandith

I am totally lost into this. Can you please guide me step by step?

@mudasirpandith

Yup. Do you hame smth like discord? JUst to text you there

@tar04
Copy link
Author

tar04 commented Dec 22, 2023

@mudasirpandith added

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

No branches or pull requests

2 participants