Drawing optimization
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user