1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! How far a figure moves along each axis, and how far a reference stands from the side it hangs
//! from. See the _Vocabulary_ rows for `Delta` and for `Reference` in
//! [`docs/diagram-model.md`](../../../docs/diagram-model.md).
use Pos;
/// How far along each axis, in cells — a figure's movement, or a gap from a side.
///
/// A horizontal amount and a vertical amount, and no third thing: the model's _Vocabulary_ gives a
/// delta that row and gives it no other. It is signed because a coordinate may be negative and a
/// displacement is a difference between two of them, and it is not [`Size`](monospace_core::Size),
/// which is `u16` and means an extent rather than a difference.
///
/// **It means two things, and the model's _Vocabulary_ row carries both.** It is how far a figure
/// *moves*, which is what a displacement and this type's own `apply` exist for, and it is how far a
/// reference stands *from the side it hangs from*, which is `Reference`'s `offset` — a gap rather
/// than a point, added by [`Endpoint::resolve`](crate::Endpoint::resolve) to whatever the anchor
/// answers now. One type and one addition serves both, so the crate keeps exactly one place where
/// coordinates are added. Reusing it is also why §1's `Delta` row needed the clause this rustdoc
/// now carries: the model's own sentence named the movement and could not have named both.
///
/// It is `Copy` because a caller holding one delta applies it to as many figures as it likes.