Add option to change distance between elements in Unfold groups (square).
@@ -9506,10 +9506,16 @@ class View(QtWidgets.QLabel):
"Set number of elements per row and column:",
100,
)
+ spacing, ok = QtWidgets.QInputDialog.getInt(
+ self,
+ "Input Dialog",
+ "Set distance between elements:",
+ 2,
+ )
if hasattr(self.all_locs[0], "group"):
- self.all_locs[0].x += np.mod(self.all_locs[0].group, n_square) * 2
- self.all_locs[0].y += np.floor(self.all_locs[0].group / n_square) * 2
+ self.all_locs[0].x += np.mod(self.all_locs[0].group, n_square) * spacing
+ self.all_locs[0].y += np.floor(self.all_locs[0].group / n_square) * spacing
mean_x = np.mean(self.locs[0].x)
mean_y = np.mean(self.locs[0].y)
@@ -9531,8 +9537,8 @@ class View(QtWidgets.QLabel):
# Also unfold picks
groups = np.unique(self.all_locs[0].group)
- shift_x = np.mod(groups, n_square) * 2 - mean_x + offset_x
- shift_y = np.floor(groups / n_square) * 2 - mean_y + offset_y
+ shift_x = np.mod(groups, n_square) * spacing - mean_x + offset_x
+ shift_y = np.floor(groups / n_square) * spacing - mean_y + offset_y
for j in range(len(self._picks)):
for k in range(len(groups)):
