@@ -1971,7 +1971,8 @@ impl<T: RenderTarget> Canvas<T> {
1971
1971
///
1972
1972
/// The implementation of `as_vertex_position` must
1973
1973
/// - be pure (have no side effects) and
1974
- /// - return a reference to an [`FPoint`] that is borrowed from `self`.
1974
+ /// - return a reference to an [`FPoint`] that is borrowed from the same allocated object as `self`
1975
+ /// and has an offset from `self` that is constant (does not change between calls).
1975
1976
pub unsafe trait AsVertexPosition {
1976
1977
fn as_vertex_position ( & self ) -> & FPoint ;
1977
1978
}
@@ -1987,9 +1988,8 @@ unsafe impl AsVertexPosition for FPoint {
1987
1988
///
1988
1989
/// # Safety
1989
1990
///
1990
- /// The implementation of `as_vertex_color` must
1991
- /// - be pure (have no side effects) and
1992
- /// - return a reference to a [`Color`][pixels::Color] that is borrowed from `self`.
1991
+ /// See [`AsVertexPosition`], but read `as_vertex_position` as `as_vertex_color` and `FPoint` as
1992
+ /// `Color`.
1993
1993
pub unsafe trait AsVertexColor {
1994
1994
fn as_vertex_color ( & self ) -> & pixels:: Color ;
1995
1995
}
@@ -2004,9 +2004,7 @@ unsafe impl AsVertexColor for pixels::Color {
2004
2004
///
2005
2005
/// # Safety
2006
2006
///
2007
- /// The implementation of `as_vertex_tex_coord` must
2008
- /// - be pure (have no side effects) and
2009
- /// - return a reference to an [`FPoint`] that is borrowed from `self`.
2007
+ /// See [`AsVertexPosition`], but read `as_vertex_position` as `as_vertex_tex_coord`.
2010
2008
pub unsafe trait AsVertexTexCoord {
2011
2009
fn as_vertex_tex_coord ( & self ) -> & FPoint ;
2012
2010
}
0 commit comments