diff options
Diffstat (limited to 'src/smart_positioning.rs')
| -rw-r--r-- | src/smart_positioning.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/smart_positioning.rs b/src/smart_positioning.rs index 81a2c3d..55d3bf3 100644 --- a/src/smart_positioning.rs +++ b/src/smart_positioning.rs @@ -10,6 +10,8 @@ pub struct LabelPosition { pub y: f64, } +// All fields relate to sizing/dimensions, so the consistent postfix is intentional and clear +#[allow(clippy::struct_field_names)] #[derive(Debug, Clone)] pub struct PositioningDimensions { pub map_size: (f64, f64), @@ -89,6 +91,8 @@ pub fn calculate_optimal_label_position_cached( ); // Score: collisions * 100 + note_collisions * 500 + distance * 0.5 + index * 0.1 + ownership + // Safe casts: collision counts and position indices are small numbers (< 1000 typically) + #[allow(clippy::cast_precision_loss)] let score = (collision_count as f64) * 100.0 + (note_collision_count as f64) * 500.0 + distance * 0.5 |