Drawing optimization

This commit is contained in:
daa84
2017-09-11 18:00:51 +03:00
parent ab6052705a
commit f7710ca912
9 changed files with 164 additions and 213 deletions

View File

@@ -292,17 +292,6 @@ mod tests {
assert_eq!(19, rect.right);
}
#[test]
fn test_repaint_rect() {
let rect = ModelRect::point(1, 1);
let (x, y, width, height) = rect.to_area(10.0, 5.0);
assert_eq!(5, x);
assert_eq!(10, y);
assert_eq!(5, width);
assert_eq!(10, height);
}
#[test]
fn test_put_area() {
let mut model = UiModel::new(10, 20);

View File

@@ -263,3 +263,19 @@ impl AsRef<ModelRect> for ModelRect {
self
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_repaint_rect() {
let rect = ModelRect::point(1, 1);
let (x, y, width, height) = rect.to_area(&CellMetrics::new_hw(10.0, 5.0));
assert_eq!(5, x);
assert_eq!(10, y);
assert_eq!(5, width);
assert_eq!(10, height);
}
}