Vixen
02b45cc4
csharp
public sealed class TerrainStrokeCommand

One brush stroke as one entry in the undo history.

Read the guide page for this →

Remarks

[docs/plan/31 § D11], and the record it wraps is the kernel's. TerrainStroke holds the layer, the union of the rectangles the stroke touched, and that rectangle's deltas before and after; this is the thing that puts it on CommandStack and tells the terrain what to recomposite either way.

⚠ Merging is off, deliberately and not by omission. Two strokes are two undos — which is what an artist means by "undo that" and what every paint application does. What does merge is inside the stroke: a drag is one TerrainStroke being extended rather than four hundred commands, so by the time one of these exists the merging has already happened.

⚠ Built at pointer-up, from a stroke that has already been applied. Every command in the editor records this way — see EditMeshCommand.Moved — because a drag applies as it goes and the command is what makes the finished state undoable rather than what performs it. So Do is a redo the first time it is not called, which is why the constructor takes the captured after-image rather than reapplying the brush.

Fields and properties (5)

  • public string Name

    What this is called in the undo history, as a person would say it.

  • public TerrainRect Rect

    Which samples the stroke touched.

  • public TerrainEditLayer Layer

    Which layer it wrote.

  • public int RecordedSamples

    How many samples the record holds, before and after together.

  • public long Bytes

    How many bytes it occupies.

Methods (4)

Used by (1)

  • TerrainEditVixen.Editor.Terrain