summaryrefslogtreecommitdiffstats
path: root/native/src/layout.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-02-23 03:09:16 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-02-23 03:09:16 +0100
commit81c75c15249b608dd8a6d47e25f96feb10ca68da (patch)
treecd069025bcda644c2cc5d00750981c927f15950f /native/src/layout.rs
parenta19f89d3a6af2804f2ac4e30f6d639b56a9bebfd (diff)
downloadiced-81c75c15249b608dd8a6d47e25f96feb10ca68da.tar.gz
iced-81c75c15249b608dd8a6d47e25f96feb10ca68da.tar.bz2
iced-81c75c15249b608dd8a6d47e25f96feb10ca68da.zip
Change `Tooltip` to support `Text` only for now
Diffstat (limited to 'native/src/layout.rs')
-rw-r--r--native/src/layout.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/native/src/layout.rs b/native/src/layout.rs
index 6d144902..b4b4a021 100644
--- a/native/src/layout.rs
+++ b/native/src/layout.rs
@@ -19,11 +19,14 @@ pub struct Layout<'a> {
}
impl<'a> Layout<'a> {
- pub(crate) fn new(node: &'a Node) -> Self {
+ /// Creates a new [`Layout`] for the given [`Node`] at the origin.
+ pub fn new(node: &'a Node) -> Self {
Self::with_offset(Vector::new(0.0, 0.0), node)
}
- pub(crate) fn with_offset(offset: Vector, node: &'a Node) -> Self {
+ /// Creates a new [`Layout`] for the given [`Node`] with the provided offset
+ /// from the origin.
+ pub fn with_offset(offset: Vector, node: &'a Node) -> Self {
let bounds = node.bounds();
Self {