aboutsummaryrefslogtreecommitdiff
path: root/src/term/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/term/mod.rs')
-rw-r--r--src/term/mod.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs
index 971755af..39213ee2 100644
--- a/src/term/mod.rs
+++ b/src/term/mod.rs
@@ -832,6 +832,10 @@ pub struct SizeInfo {
/// Horizontal window padding
pub padding_y: f32,
+
+ /// DPI factor of the current window
+ #[serde(default)]
+ pub dpr: f64,
}
impl SizeInfo {
@@ -2065,6 +2069,7 @@ mod tests {
cell_height: 3.0,
padding_x: 0.0,
padding_y: 0.0,
+ dpr: 1.0,
};
let mut term = Term::new(&Default::default(), size);
let mut grid: Grid<Cell> = Grid::new(Line(3), Column(5), 0, Cell::default());
@@ -2108,6 +2113,7 @@ mod tests {
cell_height: 3.0,
padding_x: 0.0,
padding_y: 0.0,
+ dpr: 1.0,
};
let mut term = Term::new(&Default::default(), size);
let mut grid: Grid<Cell> = Grid::new(Line(1), Column(5), 0, Cell::default());
@@ -2133,6 +2139,7 @@ mod tests {
cell_height: 3.0,
padding_x: 0.0,
padding_y: 0.0,
+ dpr: 1.0,
};
let mut term = Term::new(&Default::default(), size);
let mut grid: Grid<Cell> = Grid::new(Line(3), Column(3), 0, Cell::default());
@@ -2177,6 +2184,7 @@ mod tests {
cell_height: 3.0,
padding_x: 0.0,
padding_y: 0.0,
+ dpr: 1.0,
};
let mut term = Term::new(&Default::default(), size);
let cursor = Point::new(Line(0), Column(0));
@@ -2195,6 +2203,7 @@ mod tests {
cell_height: 3.0,
padding_x: 0.0,
padding_y: 0.0,
+ dpr: 1.0,
};
let config: Config = Default::default();
let mut term: Term = Term::new(&config, size);
@@ -2223,6 +2232,7 @@ mod tests {
cell_height: 3.0,
padding_x: 0.0,
padding_y: 0.0,
+ dpr: 1.0,
};
let config: Config = Default::default();
let mut term: Term = Term::new(&config, size);
@@ -2242,6 +2252,7 @@ mod tests {
cell_height: 3.0,
padding_x: 0.0,
padding_y: 0.0,
+ dpr: 1.0,
};
let config: Config = Default::default();
let mut term: Term = Term::new(&config, size);
@@ -2262,6 +2273,7 @@ mod tests {
cell_height: 3.0,
padding_x: 0.0,
padding_y: 0.0,
+ dpr: 1.0
};
let config: Config = Default::default();
let mut term: Term = Term::new(&config, size);
@@ -2288,6 +2300,7 @@ mod tests {
cell_height: 3.0,
padding_x: 0.0,
padding_y: 0.0,
+ dpr: 1.0,
};
let mut term = Term::new(&Default::default(), size);
let mut grid: Grid<Cell> = Grid::new(Line(1), Column(15), 0, Cell::default());
@@ -2323,6 +2336,7 @@ mod tests {
cell_height: 3.0,
padding_x: 0.0,
padding_y: 0.0,
+ dpr: 1.0,
};
let mut term = Term::new(&Default::default(), size);
let mut grid: Grid<Cell> = Grid::new(Line(1), Column(15), 0, Cell::default());
@@ -2357,6 +2371,7 @@ mod tests {
cell_height: 3.0,
padding_x: 0.0,
padding_y: 0.0,
+ dpr: 1.0,
};
let mut term = Term::new(&Default::default(), size);
let mut grid: Grid<Cell> = Grid::new(Line(1), Column(15), 0, Cell::default());