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

Generate IDs for paths for better performance #47

Open
BenJeau opened this issue Feb 4, 2022 · 1 comment
Open

Generate IDs for paths for better performance #47

BenJeau opened this issue Feb 4, 2022 · 1 comment
Milestone

Comments

@BenJeau
Copy link
Owner

BenJeau commented Feb 4, 2022

This is not currently a problem, but with #46, if this is not implemented, it will become a problem since the keys for SVG paths is simply the index, and it will not be linear like it is right now once layering is implemented.

Implementation

Generate a random ID and add it to the path:

  • UUID, but this would required extra dependencies (probable what should be done (would require uuid and react-native-get-random-values
  • Current time (most simple), but if multiple people "draw" on the same Canvas, there would be collisions
  • The path itself, but there may a problem if it happens that the user draw the exactly same path
@BenJeau BenJeau added enhancement New feature or request priority: low labels Feb 4, 2022
@BenJeau BenJeau added this to the v1.0 milestone Feb 4, 2022
@BenJeau
Copy link
Owner Author

BenJeau commented Feb 12, 2022

I think that the current time that the stroke was drawn is a good addition and we should still add a uuid to the paths or a counter (but a uuid would be easier implementation-wise)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant