Merge branch 'master' into group-solid-triangles

This commit is contained in:
Héctor Ramón Jiménez 2022-11-28 19:42:13 +01:00
commit 633150581f
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
2 changed files with 5 additions and 8 deletions

View file

@ -92,7 +92,6 @@ A bunch of simpler examples exist:
- [`custom_widget`](custom_widget), a demonstration of how to build a custom widget that draws a circle.
- [`download_progress`](download_progress), a basic application that asynchronously downloads a dummy file of 100 MB and tracks the download progress.
- [`events`](events), a log of native events displayed using a conditional `Subscription`.
- [`geometry`](geometry), a custom widget showcasing how to draw geometry with the `Mesh2D` primitive in [`iced_wgpu`](../wgpu).
- [`integration_opengl`](integration_opengl), a demonstration of how to integrate Iced in an existing OpenGL application.
- [`integration_wgpu`](integration_wgpu), a demonstration of how to integrate Iced in an existing [`wgpu`] application.
- [`pane_grid`](pane_grid), a grid of panes that can be split, resized, and reorganized.

View file

@ -383,19 +383,17 @@ where
{
let text_size = size.unwrap_or_else(|| renderer.default_size());
let text_limits = limits
let padding = padding.fit(Size::ZERO, limits.max());
let limits = limits
.pad(padding)
.width(width)
.height(Length::Units(text_size));
let limits = limits.width(width).height(Length::Shrink);
let mut text = layout::Node::new(text_limits.resolve(Size::ZERO));
let padding = padding.fit(text.size(), limits.max());
let size = limits.pad(padding).resolve(text.size()).pad(padding);
let mut text = layout::Node::new(limits.resolve(Size::ZERO));
text.move_to(Point::new(padding.left.into(), padding.top.into()));
layout::Node::with_children(size, vec![text])
layout::Node::with_children(text.size().pad(padding), vec![text])
}
/// Processes an [`Event`] and updates the [`State`] of a [`TextInput`]