Shared size modes for markers and line widths.
| 98 | #[derive(Debug, Clone, Copy, PartialEq)] |
| 99 | /// Shared size modes for markers and line widths. |
| 100 | pub enum Size { |
| 101 | /// Size in logical pixels. |
| 102 | /// |
| 103 | /// Markers are centered on the data position. Lines use this as a screen-space width. |
| 104 | /// |
| 105 | /// This is usually the right default. |
| 106 | Pixels(f32), |
| 107 | |
| 108 | /// Size in world units. |
| 109 | /// |
| 110 | /// Markers are painted such that the lower-left corner is at the data position. |
| 111 | /// Lines use this as a width measured directly in plot units. |
| 112 | /// |
| 113 | /// This is useful for implementing heatmaps and similar applications where markers |
| 114 | /// need to paint an area of the plot. |
| 115 | World(f64), |
| 116 | } |
| 117 | |
| 118 | impl From<f32> for Size { |
| 119 | fn from(size: f32) -> Self { |
nothing calls this directly
no outgoing calls
no test coverage detected