/** Returns where any of the newly linked was locked. */ final boolean linkPatches() { final Rectangle r = new Rectangle(); // for reuse final double[][] po = transformPoints(p); boolean must_lock = false; for (int i = 0; i < n_points; i++) { final Layer la = layer_set.getLayer(p_layer[0]); for (final Displayable d : la.getDisplayables(Patch.class)) { d.getBoundingBox(r); if (r.contains((int) po[0][i], (int) po[1][i])) { link(d, true); must_lock = true; } } } return must_lock; }