diff options
author | 2023-02-28 13:08:30 -0800 | |
---|---|---|
committer | 2023-02-28 13:08:30 -0800 | |
commit | 51296572c0189eaef8081c46270ff48b7e03258d (patch) | |
tree | 067b3a9102f92e4869f2a63d739a49379a9fb481 /core | |
parent | a131f11a23d3430df58bf67a7c89f4b2284822af (diff) | |
parent | 86b85d1436a44e82a9765f9d82b026faf26e22de (diff) | |
download | iced-51296572c0189eaef8081c46270ff48b7e03258d.tar.gz iced-51296572c0189eaef8081c46270ff48b7e03258d.tar.bz2 iced-51296572c0189eaef8081c46270ff48b7e03258d.zip |
Merge remote-tracking branch 'iced-main/master' into feat/multi-window-support
# Conflicts:
# glutin/src/application.rs
# winit/src/icon.rs
Diffstat (limited to '')
-rw-r--r-- | core/Cargo.toml | 2 | ||||
-rw-r--r-- | core/src/alignment.rs | 3 | ||||
-rw-r--r-- | core/src/padding.rs | 10 |
3 files changed, 7 insertions, 8 deletions
diff --git a/core/Cargo.toml b/core/Cargo.toml index 43865e4d..0d6310d3 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "iced_core" -version = "0.8.0" +version = "0.8.1" authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"] edition = "2021" description = "The essential concepts of Iced" diff --git a/core/src/alignment.rs b/core/src/alignment.rs index 73f41d3f..51b7fca9 100644 --- a/core/src/alignment.rs +++ b/core/src/alignment.rs @@ -11,9 +11,6 @@ pub enum Alignment { /// Align at the end of the axis. End, - - /// Fill the entire axis. - Fill, } impl From<Horizontal> for Alignment { diff --git a/core/src/padding.rs b/core/src/padding.rs index 752b2b86..0b1bba13 100644 --- a/core/src/padding.rs +++ b/core/src/padding.rs @@ -77,12 +77,14 @@ impl Padding { /// Fits the [`Padding`] between the provided `inner` and `outer` [`Size`]. pub fn fit(self, inner: Size, outer: Size) -> Self { let available = (outer - inner).max(Size::ZERO); + let new_top = self.top.min(available.height); + let new_left = self.left.min(available.width); Padding { - top: self.top.min(available.height / 2.0), - right: self.right.min(available.width / 2.0), - bottom: self.bottom.min(available.height / 2.0), - left: self.left.min(available.width / 2.0), + top: new_top, + bottom: self.bottom.min(available.height - new_top), + left: new_left, + right: self.right.min(available.width - new_left), } } } |