From c4cc165c5d3344cff068a55e91e102a0e11ae2c6 Mon Sep 17 00:00:00 2001 From: Joonas Javanainen Date: Wed, 12 Jul 2017 23:35:22 +0300 Subject: [PATCH] More Into sizes --- CHANGELOG.markdown | 2 +- src/child_frame.rs | 6 +++--- src/plothistogram.rs | 4 ++-- src/plotlines.rs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown index 687a5ce..5f6d006 100644 --- a/CHANGELOG.markdown +++ b/CHANGELOG.markdown @@ -16,7 +16,7 @@ ### Changed -- Button, selectable, and progress bar accept size with `Into` +- Button, selectable, histogram, plotlines, and progress bar accept size with `Into` - `ImString::new` always succeeds and any interior NULs truncate the string. **Breaking change** ### Deprecated diff --git a/src/child_frame.rs b/src/child_frame.rs index 8ba8ac0..388a472 100644 --- a/src/child_frame.rs +++ b/src/child_frame.rs @@ -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>(name: &'p ImStr, size: S) -> ChildFrame<'p> { ChildFrame { - name: name, - size: size, + name, + size: size.into(), flags: ImGuiWindowFlags::empty(), } } diff --git a/src/plothistogram.rs b/src/plothistogram.rs index a199625..b134129 100644 --- a/src/plothistogram.rs +++ b/src/plothistogram.rs @@ -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>(mut self, graph_size: S) -> Self { + self.graph_size = graph_size.into(); self } diff --git a/src/plotlines.rs b/src/plotlines.rs index c3a0430..46d53ff 100644 --- a/src/plotlines.rs +++ b/src/plotlines.rs @@ -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>(mut self, graph_size: S) -> Self { + self.graph_size = graph_size.into(); self }