added selector tool to move objects
Hi there,
note: This is still work in progress. I just want to inform you as soon as possible that something is happening here.
I started implementing a "selector"-Tool to move objects after they have been placed. So far it works for Text, Lines and Rectangles... Pencil strokes are still up for implementation.
Problems that i noticed so far:
- Moving emits a lot of updates to the servers, which results in the client getting blocked when a "drag" is done for long time.
- I dont really like that the client is working directly on the svg datatypes, while the server is working on abstract datatypes. It would be nice when they work on the same elemets. However, so far, the client doesnt know anything about this objects.
- Moving pencil strokes is not simple...
Also... this is the first time I worked with javascript... Im coming more from the embedded C++ world. So probably a lot of stuff I did is garbage. It would be nice to receive some help on this issue so we can finish this features fast. Its important :)
Ohhh I just saw that someone else is working on this issue #10
Awesome, let's work on this together !
Just a question before I dive deeper into your code: why did you choose to create a new "modify" event type instead of reusing "update" ?
* Moving emits a lot of updates to the servers, which results in the client getting blocked when a "drag" is done for long time.
I encountered this problem before, and the easiest solution is to throttle the updates. See how this is done in the pencil tool :
https://github.com/lovasoa/whitebophir/blob/master/client-data/tools/pencil/pencil.js#L61-L67
If we need it in the selection tool too, then we may want to move the throttling code to board.js so that it can be reused by all tools.
Awesome, let's work on this together. Just a question before I dive deeper into your code: why did you choose to create a new "modify" event type instead of reusing "update" ?
Fair question. I think theres no really specific reason. I guess it seemed more suitable for me to just "modify" the values that are actuallly considered by the change instead of overwriting the whole object.