​​ On Thu, Apr 19, 2018 at 7:52 AM, Joe Orr <[email protected]> wrote:
Is there a way to move a bunch of nodes at once, like move all marked nodes > up? > ​No, there isn't. There have been numerous requests to support Qt's ability to select multiple nodes at once, but there are conceptual and practical problems in doing so. A script might be able to detect multiply-selected nodes and act accordingly. But scripts must be *extremely *careful when altering multiple nodes, because the positions of nodes change when they move. For reference, see c.deletePositionsInList. It's not for the faint of heart. The basic problem is keeping track of to-be-moved nodes. This should work: - Unmark all nodes: c.clearAllMarked() - Mark all the the to-be-moved nodes. p.v.setMarked() - Move *one node at a time*. - Unmark the just-moved node. p.v.clearMarked() - Continue until no more marked nodes exist. - Redraw the screen: c.redraw() You could also use the "visited" bit instead of the "marked" bit using c.clearAllVisited(), p.v.setVisited(), and p.v.clearVisited() *Important*: the vnode methods are much faster than the position methods because they don't redraw the screen. Clear? Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.
