MCPcopy Create free account
hub / github.com/elftausend/graplot / axis_desc_y

Function axis_desc_y

src/render/plot.rs:288–300  ·  view source on GitHub ↗
(val: T, y: f32, half_width: f32, y_half_font: f32, y_font_size: f32)

Source from the content-addressed store, hash-verified

286
287
288fn axis_desc_y<T: std::fmt::Display>(val: T, y: f32, half_width: f32, y_half_font: f32, y_font_size: f32) {
289 let text = format!("{}", val);
290 let move_away = text.len();
291
292 draw_text(
293 &text,
294 half_width - 5. - (y_half_font * move_away as f32),
295 y + (y_half_font / 2.),
296 y_font_size,
297 COORD_BLACK,
298 );
299 draw_line(half_width - 4., y, half_width + 4., y, 3., COORD_DARKGRAY);
300}
301
302fn axis_desc_x<T: std::fmt::Display>(val: T, x: f32, x_half_font: f32, x_font_size: f32, half_height: f32) {
303 let text = format!("{}", val);

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected