MCPcopy Create free account
hub / github.com/donkeyteethUX/iced_plot / set_bounds

Method set_bounds

src/camera.rs:152–160  ·  view source on GitHub ↗
(&mut self, bounds_min: DVec2, bounds_max: DVec2, padding_frac: f64)

Source from the content-addressed store, hash-verified

150 }
151
152 pub(crate) fn set_bounds(&mut self, bounds_min: DVec2, bounds_max: DVec2, padding_frac: f64) {
153 let size = (bounds_max - bounds_min).max(DVec2::splat(EPSILON_SMALL));
154 let size_padded = size + size * padding_frac;
155 self.half_extents = size_padded / 2.0;
156 let center = (bounds_min + bounds_max) / 2.0;
157 self.position = center;
158 // Set render_offset to center for high-precision rendering near zero
159 self.render_offset = center;
160 }
161}

Callers 1

autoscaleMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected