Skip to content

Commit f336093

Browse files
authored
Size Constraints Example (#7956)
# Objective Add a simple example demonstrating how to use size constraints. Related to #7946 # Solution <img width="827" alt="Capture" src="https://user-images.githubusercontent.com/27962798/223741566-4b8eca99-c450-42b5-a40e-a414858c8310.PNG"> # Changelog * Added the example `size_constraints`
1 parent 9a3225d commit f336093

File tree

3 files changed

+410
-0
lines changed

3 files changed

+410
-0
lines changed

Cargo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,6 +1802,16 @@ description = "Showcases the RelativeCursorPosition component"
18021802
category = "UI (User Interface)"
18031803
wasm = true
18041804

1805+
[[example]]
1806+
name = "size_constraints"
1807+
path = "examples/ui/size_constraints.rs"
1808+
1809+
[package.metadata.example.size_constraints]
1810+
name = "Size Constraints"
1811+
description = "Demonstrates how the to use the size constraints to control the size of a UI node."
1812+
category = "UI (User Interface)"
1813+
wasm = true
1814+
18051815
[[example]]
18061816
name = "text"
18071817
path = "examples/ui/text.rs"

examples/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ Example | Description
338338
[Overflow](../examples/ui/overflow.rs) | Simple example demonstrating overflow behavior
339339
[Overflow and Clipping Debug](../examples/ui/overflow_debug.rs) | An example to debug overflow and clipping behavior
340340
[Relative Cursor Position](../examples/ui/relative_cursor_position.rs) | Showcases the RelativeCursorPosition component
341+
[Size Constraints](../examples/ui/size_constraints.rs) | Demonstrates how the to use the size constraints to control the size of a UI node.
341342
[Text](../examples/ui/text.rs) | Illustrates creating and updating text
342343
[Text Debug](../examples/ui/text_debug.rs) | An example for debugging text layout
343344
[Text Wrap Debug](../examples/ui/text_wrap_debug.rs) | Demonstrates text wrapping

0 commit comments

Comments
 (0)