Re: Multiple paste & Distribute on high (on z axes)

by dorin » Mon Apr 29, 2019 9:52 am

Message in a Bottle -The Police - 1979
As I say "If You don't like it AS IS than DIY".
I've start to write an plug-in for this but I encounter a problem:
Look at the screenshot:
Image

The items are added in 3D and in Furniture list but only the last are draw in 2D.
If I save the file and reopen the items are there but is not what I want or expect.
Here is the code responsible for this:

Code: Select all

UndoableEditSupport undoSupport = plugin.getUndoableEditSupport();
 		undoSupport.beginUpdate();
 //		HomeView view = plugin.getHomeController().getView();
 		float dx = 0;
 		float dy = 0;
 		int step = (int) stepsField.getValue();
 		float Xo = (float) xField.getValue();
 		float Yo = (float) yField.getValue();
 		for (int p = 1; p <= step; p++) {
 			dx += Xo;
 			dy += Yo;
 			// Attempt add/move items
 			plugin.getHomeController().getPlanController().addItems(items);
 			plugin.getHomeController().getPlanController().moveItems(items, dx, dy);
 			 // Attempt to use drop or paste
 //			plugin.getHomeController().drop(items, null, dx, dy);
 //			plugin.getHomeController().paste(items);
 	 		}
 		undoSupport.postEdit(new AbstractUndoableEdit() {
I mess something but I don't know what.
I've catch my ears and maybe someone read this and drop me an lifeline [:(]