Skip to content

Commit 10f5284

Browse files
authored
Better document pre_existing (#20)
1 parent 820f241 commit 10f5284

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,14 @@ impl Layer {
217217
ptr as *mut _
218218
}
219219

220-
/// Whether `raw-window-metal` created a new [`CAMetalLayer`] for you.
220+
/// If `raw-window-metal` created a new [`CAMetalLayer`] for you, this returns `false`.
221+
///
222+
/// This may be useful if you want to override some part of `raw-window-metal`'s behaviour, and
223+
/// need to do so based on whether it ended up creating a layer or not.
224+
///
225+
/// You should try to avoid this, and instead:
226+
/// - Modify `CALayer` properties on the layer that you created this from.
227+
/// - Modify `CAMetalLayer` properties on the layer returned from `as_ptr`.
221228
#[inline]
222229
pub fn pre_existing(&self) -> bool {
223230
self.pre_existing

0 commit comments

Comments
 (0)