More Into<ImVec2> sizes

This commit is contained in:
Joonas Javanainen 2017-07-12 23:35:22 +03:00
parent 932319256f
commit c4cc165c5d
No known key found for this signature in database
GPG Key ID: D39CCA5CB19B9179
4 changed files with 8 additions and 8 deletions

View File

@ -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

View File

@ -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(),
}
}

View File

@ -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
}

View File

@ -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
}