draw2d icon indicating copy to clipboard operation
draw2d copied to clipboard

Cannot drag shapes beyond initial window size

Open gitgitwhat opened this issue 6 years ago • 5 comments

No matter what size I make the canvas, I am not able to move a shape beyond the initial window size. This can be seen with the "shape db" example found at https://freegroup.github.io/draw2d/index.html

gitgitwhat avatar Oct 19 '19 20:10 gitgitwhat

See #64

I had the same problem. Hope it helps

InannaInai avatar Oct 29 '19 13:10 InannaInai

This is controlled by the default RegionEditPolicy in Canvas, which is constructed with the canvas's initial size and won't allow movement beyond those bounds. To get around it, you could install a new RegionEditPolicy with different size constraints. Or, If you need your canvas to be resizable, you could call canvas.regionDragDropConstraint.setBoundingBox when the canvas is resized and pass in the new dimensions.

RThomasHyde avatar Mar 26 '20 23:03 RThomasHyde

Hi, @gitgitwhat did you find the solution to this problem? Share it with me please if you find it

Samanoova avatar Oct 07 '20 08:10 Samanoova

Hi, @gitgitwhat did you find the solution to this problem? Share it with me please if you find it

You can enlarge the canvas bejond the windows size. For example you should place the canvas in a div and give that div a veeeeery large size than you place an other div around that div.

<div id="some random size or window size" size="small size allow resize">
       <div id ="canvas" size="very large">
       </div>
</div>

It may be just a workaround, but it worked foe me.

InannaInai avatar Oct 07 '20 08:10 InannaInai

Hi @InannaInai I did that and can scroll with the mouse wheel but if I cant to scroll while dragging and if use the wheel I will face that problem something like a lag between mouse position and event

Samanoova avatar Oct 07 '20 09:10 Samanoova