|
@@ -2,6 +2,7 @@ use std::fmt::{Debug, Display};
|
|
|
|
|
|
use binrw::{BinRead, BinWrite};
|
|
|
use diff::Diff;
|
|
|
+use num::abs;
|
|
|
|
|
|
use crate::{
|
|
|
field_of::FieldOf,
|
|
@@ -28,7 +29,23 @@ pub struct Rectangle {
|
|
|
|
|
|
impl Display for Rectangle {
|
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
|
- write!(f, "{}", self.core)
|
|
|
+ write!(
|
|
|
+ f,
|
|
|
+ "{}, Origin: {}, Width: {}, Height: {}",
|
|
|
+ self.core,
|
|
|
+ Coordinate {
|
|
|
+ x: self.modifier.modifiers.correction.x
|
|
|
+ + (self.drawn_corner_a.x + self.drawn_corner_b.x) / 2.0
|
|
|
+ * self.modifier.modifiers.x_scale,
|
|
|
+ y: self.modifier.modifiers.correction.y
|
|
|
+ + (self.drawn_corner_a.y + self.drawn_corner_b.y) / 2.0
|
|
|
+ * self.modifier.modifiers.y_scale,
|
|
|
+ },
|
|
|
+ (abs(self.drawn_corner_a.x) + abs(self.drawn_corner_b.x)) / 2.0
|
|
|
+ * self.modifier.modifiers.x_scale,
|
|
|
+ (abs(self.drawn_corner_a.y) + abs(self.drawn_corner_b.y)) / 2.0
|
|
|
+ * self.modifier.modifiers.y_scale,
|
|
|
+ )
|
|
|
}
|
|
|
}
|
|
|
|