0

I have a question about Draw2D.js. I have to use ONLY rectangular blocks, so I want the user to only be able to alter the length of the rectangle and prohibit the possibility of modifying its width.

In addition, the length should be limited to multiples of a fixed value, indicated by the grid.

1 Answers1

0

Draw2d does have WidthSelectionFeedbackPolicy which operates on a Figure - see http://www.draw2d.org/draw2d_touch/jsdoc_6/#!/api/draw2d.policy.figure.WidthSelectionFeedbackPolicy

This restricts users to altering the width of a rectangle (ie in the horizontal direction) but they can't alter it in the vertical direction.

So I suggest you have a look at the source code for that policy and change it to create one which restricts it according to your requirements. I would expect that using this approach you can restrict the length to multiples, but I can't confirm that.

Robbie Jackson
  • 268
  • 2
  • 6