mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-27 05:18:27 +00:00
DrawAPI: Remove unused lifetime
This commit is contained in:
parent
7be9f15acb
commit
3aa807b173
@ -48,7 +48,7 @@ impl From<(f32, f32, f32)> for ImColor {
|
|||||||
/// All types from which ImGui's custom draw API can be used implement this
|
/// All types from which ImGui's custom draw API can be used implement this
|
||||||
/// trait. This trait is internal to this library and implemented by
|
/// trait. This trait is internal to this library and implemented by
|
||||||
/// `WindowDrawList` and `ChannelsSplit`.
|
/// `WindowDrawList` and `ChannelsSplit`.
|
||||||
pub trait DrawAPI<'ui> {
|
pub trait DrawAPI {
|
||||||
/// Get draw_list object
|
/// Get draw_list object
|
||||||
fn draw_list(&self) -> *mut ImDrawList;
|
fn draw_list(&self) -> *mut ImDrawList;
|
||||||
}
|
}
|
||||||
@ -59,7 +59,7 @@ pub struct WindowDrawList<'ui> {
|
|||||||
_phantom: PhantomData<&'ui Ui<'ui>>,
|
_phantom: PhantomData<&'ui Ui<'ui>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'ui> DrawAPI<'ui> for WindowDrawList<'ui> {
|
impl<'ui> DrawAPI for WindowDrawList<'ui> {
|
||||||
fn draw_list(&self) -> *mut ImDrawList { self.draw_list }
|
fn draw_list(&self) -> *mut ImDrawList { self.draw_list }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ impl<'ui> WindowDrawList<'ui> {
|
|||||||
/// Represent the drawing interface within a call to `channels_split`.
|
/// Represent the drawing interface within a call to `channels_split`.
|
||||||
pub struct ChannelsSplit<'ui>(&'ui WindowDrawList<'ui>);
|
pub struct ChannelsSplit<'ui>(&'ui WindowDrawList<'ui>);
|
||||||
|
|
||||||
impl<'ui> DrawAPI<'ui> for ChannelsSplit<'ui> {
|
impl<'ui> DrawAPI for ChannelsSplit<'ui> {
|
||||||
fn draw_list(&self) -> *mut ImDrawList { self.0.draw_list }
|
fn draw_list(&self) -> *mut ImDrawList { self.0.draw_list }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ macro_rules! impl_draw_list_methods {
|
|||||||
($T: ident) => {
|
($T: ident) => {
|
||||||
impl<'ui> $T<'ui>
|
impl<'ui> $T<'ui>
|
||||||
where
|
where
|
||||||
$T<'ui>: DrawAPI<'ui>,
|
$T<'ui>: DrawAPI,
|
||||||
{
|
{
|
||||||
/// Returns a line from point `p1` to `p2` with color `c`.
|
/// Returns a line from point `p1` to `p2` with color `c`.
|
||||||
pub fn add_line<P1, P2, C>(&self, p1: P1, p2: P2, c: C) -> Line<'ui, $T>
|
pub fn add_line<P1, P2, C>(&self, p1: P1, p2: P2, c: C) -> Line<'ui, $T>
|
||||||
@ -270,7 +270,7 @@ pub struct Line<'ui, D: 'ui> {
|
|||||||
draw_list: &'ui D,
|
draw_list: &'ui D,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'ui, D: DrawAPI<'ui>> Line<'ui, D> {
|
impl<'ui, D: DrawAPI> Line<'ui, D> {
|
||||||
fn new<P1, P2, C>(draw_list: &'ui D, p1: P1, p2: P2, c: C) -> Self
|
fn new<P1, P2, C>(draw_list: &'ui D, p1: P1, p2: P2, c: C) -> Self
|
||||||
where
|
where
|
||||||
P1: Into<ImVec2>,
|
P1: Into<ImVec2>,
|
||||||
@ -318,7 +318,7 @@ pub struct Rect<'ui, D: 'ui> {
|
|||||||
draw_list: &'ui D,
|
draw_list: &'ui D,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'ui, D: DrawAPI<'ui>> Rect<'ui, D> {
|
impl<'ui, D: DrawAPI> Rect<'ui, D> {
|
||||||
fn new<P1, P2, C>(draw_list: &'ui D, p1: P1, p2: P2, c: C) -> Self
|
fn new<P1, P2, C>(draw_list: &'ui D, p1: P1, p2: P2, c: C) -> Self
|
||||||
where
|
where
|
||||||
P1: Into<ImVec2>,
|
P1: Into<ImVec2>,
|
||||||
@ -420,7 +420,7 @@ pub struct Triangle<'ui, D: 'ui> {
|
|||||||
draw_list: &'ui D,
|
draw_list: &'ui D,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'ui, D: DrawAPI<'ui>> Triangle<'ui, D> {
|
impl<'ui, D: DrawAPI> Triangle<'ui, D> {
|
||||||
fn new<P1, P2, P3, C>(draw_list: &'ui D, p1: P1, p2: P2, p3: P3, c: C) -> Self
|
fn new<P1, P2, P3, C>(draw_list: &'ui D, p1: P1, p2: P2, p3: P3, c: C) -> Self
|
||||||
where
|
where
|
||||||
P1: Into<ImVec2>,
|
P1: Into<ImVec2>,
|
||||||
@ -489,7 +489,7 @@ pub struct Circle<'ui, D: 'ui> {
|
|||||||
draw_list: &'ui D,
|
draw_list: &'ui D,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'ui, D: DrawAPI<'ui>> Circle<'ui, D> {
|
impl<'ui, D: DrawAPI> Circle<'ui, D> {
|
||||||
pub fn new<P, C>(draw_list: &'ui D, center: P, radius: f32, color: C) -> Self
|
pub fn new<P, C>(draw_list: &'ui D, center: P, radius: f32, color: C) -> Self
|
||||||
where
|
where
|
||||||
P: Into<ImVec2>,
|
P: Into<ImVec2>,
|
||||||
@ -565,7 +565,7 @@ pub struct BezierCurve<'ui, D: 'ui> {
|
|||||||
draw_list: &'ui D,
|
draw_list: &'ui D,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'ui, D: DrawAPI<'ui>> BezierCurve<'ui, D> {
|
impl<'ui, D: DrawAPI> BezierCurve<'ui, D> {
|
||||||
fn new<P1, P2, P3, P4, C>(draw_list: &'ui D, pos0: P1, cp0: P2, cp1: P3, pos1: P4, c: C) -> Self
|
fn new<P1, P2, P3, P4, C>(draw_list: &'ui D, pos0: P1, cp0: P2, cp1: P3, pos1: P4, c: C) -> Self
|
||||||
where
|
where
|
||||||
P1: Into<ImVec2>,
|
P1: Into<ImVec2>,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user