Merge branch 'master' of github.com:dankamongmen/notcurses

This commit is contained in:
nick black 2021-05-06 23:52:43 -04:00
commit 1b4d346fb1
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC
2 changed files with 15 additions and 17 deletions

View File

@ -1020,18 +1020,24 @@ impl NcPlane {
"NcPlane.move_below(NcPlane)" "NcPlane.move_below(NcPlane)"
] ]
} }
/// Merge the NcPlane `source` down onto the current NcPlane (`self`).
/// Merges `source` down onto this NcPlane.
/// ///
/// Merging is independent of the position of both NcPlanes on the z-axis. /// This is most rigorously defined as "write to `self` the frame that would
/// be rendered were the entire stack made up only of the specified subregion
/// of `source` and, below it, the subregion of `self` having the specified
/// origin.
///
/// Merging is independent of the position of both planes on the z-axis.
/// ///
/// It is an error to define a subregion of zero area, or that is not /// It is an error to define a subregion of zero area, or that is not
/// entirely contained within `source`. /// entirely contained within `source`. It is an error to define a target
/// origin such that the projected subregion is not entirely contained
/// within `self`.
/// ///
/// It is an error to define a target origin such that the projected /// Behavior is undefined if both planes are equivalent. `self` is modified,
/// subregion is not entirely contained within 'dst'. /// but `source` remains unchanged.
/// ///
/// Behavior is undefined if both NcPlanes are equivalent. /// neither `source` nor `self` may have sprixels.
/// ///
/// *C style function: [ncplane_mergedown()][crate::ncplane_mergedown].* /// *C style function: [ncplane_mergedown()][crate::ncplane_mergedown].*
pub fn mergedown( pub fn mergedown(

View File

@ -13,11 +13,7 @@ pub type NcResizeCbUnsafe = unsafe extern "C" fn(*mut NcPlane) -> NcIntResult;
/// Converts [NcResizeCbUnsafe] to [NcResizeCb]. /// Converts [NcResizeCbUnsafe] to [NcResizeCb].
pub fn ncresizecb_to_rust(resizecb: Option<NcResizeCbUnsafe>) -> Option<NcResizeCb> { pub fn ncresizecb_to_rust(resizecb: Option<NcResizeCbUnsafe>) -> Option<NcResizeCb> {
if let Some(cb) = resizecb { resizecb.map(|cb| unsafe { core::mem::transmute(cb) })
Some(unsafe { core::mem::transmute(cb) })
} else {
None
}
} }
/// Converts [NcResizeCb] to [NcResizeCbUnsafe]. /// Converts [NcResizeCb] to [NcResizeCbUnsafe].
@ -25,11 +21,7 @@ pub fn ncresizecb_to_rust(resizecb: Option<NcResizeCbUnsafe>) -> Option<NcResize
// waiting for https://github.com/rust-lang/rust/issues/53605 // waiting for https://github.com/rust-lang/rust/issues/53605
// to make this function const, and then NcPlaneOptions constructors. // to make this function const, and then NcPlaneOptions constructors.
pub fn ncresizecb_to_c(resizecb: Option<NcResizeCb>) -> Option<NcResizeCbUnsafe> { pub fn ncresizecb_to_c(resizecb: Option<NcResizeCb>) -> Option<NcResizeCbUnsafe> {
if let Some(cb) = resizecb { resizecb.map(|cb| unsafe { core::mem::transmute(cb) })
Some(unsafe { core::mem::transmute(cb) })
} else {
None
}
} }
/// Enables the [NcResizeCb] methods. /// Enables the [NcResizeCb] methods.