mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-13 22:48:34 +00:00
More Into<ImVec2> sizes
This commit is contained in:
parent
932319256f
commit
c4cc165c5d
@ -16,7 +16,7 @@
|
||||
|
||||
### Changed
|
||||
|
||||
- Button, selectable, and progress bar accept size with `Into<ImVec2>`
|
||||
- Button, selectable, histogram, plotlines, and progress bar accept size with `Into<ImVec2>`
|
||||
- `ImString::new` always succeeds and any interior NULs truncate the string. **Breaking change**
|
||||
|
||||
### Deprecated
|
||||
|
||||
@ -18,10 +18,10 @@ pub struct ChildFrame<'p> {
|
||||
}
|
||||
|
||||
impl<'p> ChildFrame<'p> {
|
||||
pub fn new(name: &'p ImStr, size: ImVec2) -> ChildFrame<'p> {
|
||||
pub fn new<S: Into<ImVec2>>(name: &'p ImStr, size: S) -> ChildFrame<'p> {
|
||||
ChildFrame {
|
||||
name: name,
|
||||
size: size,
|
||||
name,
|
||||
size: size.into(),
|
||||
flags: ImGuiWindowFlags::empty(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,8 +53,8 @@ impl<'p> PlotHistogram<'p> {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn graph_size(mut self, graph_size: ImVec2) -> Self {
|
||||
self.graph_size = graph_size;
|
||||
pub fn graph_size<S: Into<ImVec2>>(mut self, graph_size: S) -> Self {
|
||||
self.graph_size = graph_size.into();
|
||||
self
|
||||
}
|
||||
|
||||
|
||||
@ -52,8 +52,8 @@ impl<'p> PlotLines<'p> {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn graph_size(mut self, graph_size: ImVec2) -> Self {
|
||||
self.graph_size = graph_size;
|
||||
pub fn graph_size<S: Into<ImVec2>>(mut self, graph_size: S) -> Self {
|
||||
self.graph_size = graph_size.into();
|
||||
self
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user