FIX: Column/Row width/height UI issues

This commit is contained in:
Nicolás Hatcher
2024-10-26 22:39:40 +02:00
committed by Nicolás Hatcher Andrés
parent 04d8c658ab
commit 0c69889832
5 changed files with 13 additions and 11 deletions

View File

@@ -2,8 +2,8 @@
/// COLUMN_WIDTH and ROW_HEIGHT are pixel values
/// A column width of Excel value `w` will result in `w * COLUMN_WIDTH_FACTOR` pixels
/// Note that these constants are inlined
pub(crate) const DEFAULT_COLUMN_WIDTH: f64 = 100.0;
pub(crate) const DEFAULT_ROW_HEIGHT: f64 = 22.0;
pub(crate) const DEFAULT_COLUMN_WIDTH: f64 = 125.0;
pub(crate) const DEFAULT_ROW_HEIGHT: f64 = 28.0;
pub(crate) const COLUMN_WIDTH_FACTOR: f64 = 12.0;
pub(crate) const ROW_HEIGHT_FACTOR: f64 = 2.0;
pub(crate) const DEFAULT_WINDOW_HEIGH: i64 = 600;

View File

@@ -7,7 +7,7 @@ use csv_sniffer::Sniffer;
use serde::{Deserialize, Serialize};
use crate::{
constants,
constants::{self, DEFAULT_ROW_HEIGHT},
expressions::{
types::{Area, CellReferenceIndex},
utils::{is_valid_column_number, is_valid_row},
@@ -374,7 +374,7 @@ impl UserModel {
let line_count = value.split("\n").count();
let row_height = self.model.get_row_height(sheet, row)?;
let cell_height = (line_count * 22) as f64;
let cell_height = (line_count as f64) * DEFAULT_ROW_HEIGHT;
if cell_height > row_height {
diff_list.push(Diff::SetRowHeight {
sheet,