edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiB0563cbfTahinli2 months ago824 commits
| 1 | //! The transform card's numbers -- [`crate::color_ui`]'s twin for where a |
| 2 | //! clip sits instead of what it looks like. |
| 3 | |
| 4 | use crate::*; |
| 5 | |
| 6 | /// The transform card's eight controls, in the order it lists them: what each |
| 7 | /// is called and the range it moves in. The order is `TransformParams`' own, |
| 8 | /// which is what [`transform_band_mut`] indexes. Rotation's range is one turn |
| 9 | /// short (`0..270`) because 360 is the same picture as 0 and a slider with two |
| 10 | /// ends that read the same is not a range, it is a cycle |
| 11 | /// ([`ROTATE_BAND`]/[`rotate_key`]). |
| 12 | pub const TRANSFORM_BANDS: = |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | ; |
| 22 | |
| 23 | /// Which band is rotation: the one control on the card that wraps at its ends |
| 24 | /// instead of clamping, and steps by [`ROTATE_STEP`] rather than |
| 25 | /// [`TRANSFORM_STEP`] -- the engine only ever renders a 90-degree turn |
| 26 | /// ([`crate::transform::TransformParams::rotate`]), so a finer grid on this |
| 27 | /// one row would be numbers nothing on screen answers to. |
| 28 | pub const ROTATE_BAND: usize = 3; |
| 29 | |
| 30 | /// Which band is scale: the one control on the card whose unit is a |
| 31 | /// multiplier (`×`) rather than a percent of frame or a degree. |
| 32 | pub const SCALE_BAND: usize = 2; |
| 33 | |
| 34 | /// A press of a nudge key on every band but rotation: a fortieth-ish of a |
| 35 | /// band's range, [`crate::color_ui::COLOR_STEP`]'s own reason. A drag lands on |
| 36 | /// the same grid ([`Player::drag_transform`]). |
| 37 | pub const TRANSFORM_STEP: f32 = 0.05; |
| 38 | |
| 39 | /// Rotation's own step: one 90-degree turn, [`ROTATE_BAND`]'s reason. |
| 40 | pub const ROTATE_STEP: f32 = 90.; |
| 41 | |
| 42 | /// The card's width, [`crate::color_ui::COLOR_W`]'s own measure against this |
| 43 | /// card's longest label ("Position X" is short, but the value column is wider |
| 44 | /// here for the crop rows' extra digit). |
| 45 | pub const TRANSFORM_W: f32 = 460.; |
| 46 | /// How much of a slider row the bar itself gets, [`crate::color_ui::COLOR_BAR_W`]. |
| 47 | pub const TRANSFORM_BAR_W: f32 = 240.; |
| 48 | |
| 49 | /// A slider value on the band's own grid: [`ROTATE_BAND`] snaps to |
| 50 | /// [`ROTATE_STEP`] and wraps into its range, every other band snaps to |
| 51 | /// [`TRANSFORM_STEP`] and clamps into its own -- what a drag rounds to, so the |
| 52 | /// pointer stops where the arrow keys do. |
| 53 | pub |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | /// The band'th control of a placement, to read or to write. The order is |
| 68 | /// [`TRANSFORM_BANDS`]', which is the order the card lists them in -- |
| 69 | /// [`crate::export_ui::band_mut`]'s own twin. |
| 70 | pub |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 |