Skip to main content

Module protect

Module protect 

Source
Expand description

Per-vertex protection around a position-moving operation.

with_protection runs any operation in a transaction, then scales back what it did to the listed vertices. It knows nothing of the operation’s insides, so brushes keep one code path whether or not anything is protected.

Functions§

check_protection
Checks a protection list the way with_protection does.
with_protection
Runs op in tx, then scales each listed vertex’s move by its weight: 0 leaves the vertex at the bits it had before op, 1 keeps the whole move, and values in between land on the straight line between the two.