mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
Dead code: MinMaxBoundingBox (#266)
* remove unused struct * remove unused destructured parameters
This commit is contained in:
parent
5cd3e503cc
commit
669ccef4c6
@ -11,9 +11,8 @@ use crate::{
|
||||
pub fn upload_system(
|
||||
MapContext {
|
||||
world,
|
||||
style,
|
||||
view_state,
|
||||
renderer: Renderer { device, queue, .. },
|
||||
renderer: Renderer { queue, .. },
|
||||
..
|
||||
}: &mut MapContext,
|
||||
) {
|
||||
|
||||
@ -4,59 +4,11 @@ use std::ops::{Deref, DerefMut};
|
||||
|
||||
pub use fps_meter::FPSMeter;
|
||||
|
||||
use crate::coords::WorldTileCoords;
|
||||
|
||||
mod fps_meter;
|
||||
pub mod grid;
|
||||
pub mod label;
|
||||
pub mod math;
|
||||
|
||||
struct MinMaxBoundingBox {
|
||||
min_x: i32,
|
||||
min_y: i32,
|
||||
max_x: i32,
|
||||
max_y: i32,
|
||||
initialized: bool,
|
||||
}
|
||||
|
||||
impl Default for MinMaxBoundingBox {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
min_x: i32::MAX,
|
||||
min_y: i32::MAX,
|
||||
max_x: i32::MIN,
|
||||
max_y: i32::MIN,
|
||||
initialized: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl MinMaxBoundingBox {
|
||||
pub fn is_initialized(&self) -> bool {
|
||||
self.initialized
|
||||
}
|
||||
|
||||
pub fn update(&mut self, world_coords: &WorldTileCoords) {
|
||||
self.initialized = true;
|
||||
|
||||
if world_coords.x < self.min_x {
|
||||
self.min_x = world_coords.x;
|
||||
}
|
||||
|
||||
if world_coords.y < self.min_y {
|
||||
self.min_y = world_coords.y;
|
||||
}
|
||||
|
||||
if world_coords.x > self.max_x {
|
||||
self.max_x = world_coords.x;
|
||||
}
|
||||
|
||||
if world_coords.y > self.max_y {
|
||||
self.max_y = world_coords.y;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait SignificantlyDifferent<Rhs: ?Sized = Self> {
|
||||
type Epsilon;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user