Repository: iced-rs/iced (language: rust)

Issue:
Wrapped row with spacing can overlap subsequent content
### Is your issue REALLY a bug?

- [X] My issue is indeed a bug!
- [X] I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.

### Is there an existing issue for this?

- [X] I have searched the existing issues.

### Is this issue related to iced?

- [X] My hardware is compatible and my graphics drivers are up-to-date.

### What happened?

If a `Row` uses both `.wrap()` and `.spacing()`, the last wrapped line can overlap other content in the window.

SSCCE: https://gist.github.com/mtkennerly/f3f9cbcdc2876a1be351fb057d575dbb

> https://github.com/user-attachments/assets/15229fde-62d1-48a5-a530-0c596e75375f


### What is the expected behavior?

The last line should not overlap any other content.

### Version

crates.io release

### Operating System

Windows

### Do you have any log output?

_No response_


Discussion / hints:

Fix patch:
diff --git a/widget/src/row.rs b/widget/src/row.rs
index fbb3f06676..75d5fb407b 100644
--- a/widget/src/row.rs
+++ b/widget/src/row.rs
@@ -477,7 +477,7 @@ where
             intrinsic_size.width = intrinsic_size.width.max(x - spacing);
         }
 
-        intrinsic_size.height = (y - spacing).max(0.0) + row_height;
+        intrinsic_size.height = y + row_height;
         align(row_start..children.len(), row_height, &mut children);
 
         let size =


Test patch: