Skip to content
  • Ell's avatar
    Issue #1850 - Undoing the "straighten" operation in the Measure tool ... · 2e08c916
    Ell authored
    ... does not restore the measure points
    
    Halt the measure tool after straightening, thus removing the
    expectation that undoing the operation should restore the original
    points.
    
    Halting the tool, rather than making undo work "as expected",
    sidesteps several issues:
    
      - Implementing undo correctly is tricky, since image-undo and
        tool-undo are handled separately.
    
      - In fact, the measure tool doesn't provide tool-undo, so that
        image edits can be undone while the tool is active without
        affecting the tool, and it's not clear that we want to change
        this behavior.  However, this makes undoing a straighten
        operation a special case, and it's not entirely clear what the
        behavior should be when undoing other kinds of transformations,
        or when the measure points had changed since the straighten
        operation.
    
      - Perhaps most importantly, measure tool points are restricted to
        the pixel grid, which means that when measuring an angle
        against an orientation that's not fully horizontal or vertical
        in image space (either using a 3-point angle, or when the
        canvas is rotated), the resulting transformed point after
        straightening doesn't generally land on the pixel grid, causing
        it to be rounded, which can result in a non-zero angle after
        the rotation.  This is especially ugly, since clicking
        "straighten" again at this point would cause another non-
        trivial rotation.
    2e08c916