Even width and height comparisons
This commit is contained in:
@@ -176,6 +176,9 @@ impl RawTransform {
|
||||
let child_bottom = self.y + self.height;
|
||||
let parent_bottom = parent.y + parent.height;
|
||||
|
||||
let child_right = self.x + self.width;
|
||||
let parent_right = parent.x + parent.width;
|
||||
|
||||
if child_bottom > parent_bottom {
|
||||
if parent_bottom > self.y {
|
||||
self.height = parent_bottom - self.y;
|
||||
@@ -183,6 +186,14 @@ impl RawTransform {
|
||||
self.height = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if child_right > parent_right {
|
||||
if parent_right > self.x {
|
||||
self.width = parent_right - self.x;
|
||||
} else {
|
||||
self.width = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user