whitebophir icon indicating copy to clipboard operation
whitebophir copied to clipboard

added selector tool to move objects

Open Mk-arc opened this issue 6 years ago • 4 comments

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 :)

Mk-arc avatar Apr 08 '20 18:04 Mk-arc

Ohhh I just saw that someone else is working on this issue #10

Mk-arc avatar Apr 08 '20 18:04 Mk-arc

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" ?

lovasoa avatar Apr 08 '20 19:04 lovasoa

* 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.

lovasoa avatar Apr 08 '20 19:04 lovasoa

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.

Mk-arc avatar Apr 08 '20 20:04 Mk-arc