switch to mongodb, add drag&drop

This commit is contained in:
Johannes Heuel
2023-02-23 18:28:12 +01:00
parent 61d0bbe4d1
commit ac27cba766
38 changed files with 3273 additions and 730 deletions

View File

@@ -1,4 +1,5 @@
use pathfinding::prelude::dijkstra;
use weblog::console_log;
pub struct Rect {
pub width: u32,
@@ -6,7 +7,8 @@ pub struct Rect {
}
pub fn get_common_height(row: &[Rect], container_width: u32, margin: u32) -> f32 {
let row_width: u32 = container_width - row.len() as u32 * (margin * 2);
debug_assert!(container_width > (row.len() as u32) * (margin * 2));
let row_width: u32 = container_width - (row.len() as u32) * (margin * 2);
let total_aspect_ratio: f32 = row
.iter()
.map(|p| (p.width as f32) / (p.height as f32))