Point to caller's location when using log_or_panic (#2552)
This commit is contained in:
parent
34f587d1e1
commit
e70204d726
2 changed files with 4 additions and 0 deletions
|
@ -144,6 +144,7 @@ pub struct Strip<'a, 'b> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, 'b> Strip<'a, 'b> {
|
impl<'a, 'b> Strip<'a, 'b> {
|
||||||
|
#[cfg_attr(debug_assertions, track_caller)]
|
||||||
fn next_cell_size(&mut self) -> (CellSize, CellSize) {
|
fn next_cell_size(&mut self) -> (CellSize, CellSize) {
|
||||||
let size = if let Some(size) = self.sizes.get(self.size_index) {
|
let size = if let Some(size) = self.sizes.get(self.size_index) {
|
||||||
self.size_index += 1;
|
self.size_index += 1;
|
||||||
|
@ -163,6 +164,7 @@ impl<'a, 'b> Strip<'a, 'b> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add cell contents.
|
/// Add cell contents.
|
||||||
|
#[cfg_attr(debug_assertions, track_caller)]
|
||||||
pub fn cell(&mut self, add_contents: impl FnOnce(&mut Ui)) {
|
pub fn cell(&mut self, add_contents: impl FnOnce(&mut Ui)) {
|
||||||
let (width, height) = self.next_cell_size();
|
let (width, height) = self.next_cell_size();
|
||||||
let striped = false;
|
let striped = false;
|
||||||
|
@ -171,6 +173,7 @@ impl<'a, 'b> Strip<'a, 'b> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add an empty cell.
|
/// Add an empty cell.
|
||||||
|
#[cfg_attr(debug_assertions, track_caller)]
|
||||||
pub fn empty(&mut self) {
|
pub fn empty(&mut self) {
|
||||||
let (width, height) = self.next_cell_size();
|
let (width, height) = self.next_cell_size();
|
||||||
self.layout.empty(width, height);
|
self.layout.empty(width, height);
|
||||||
|
|
|
@ -1026,6 +1026,7 @@ impl<'a, 'b> TableRow<'a, 'b> {
|
||||||
/// Add the contents of a column.
|
/// Add the contents of a column.
|
||||||
///
|
///
|
||||||
/// Return the used space (`min_rect`) plus the [`Response`] of the whole cell.
|
/// Return the used space (`min_rect`) plus the [`Response`] of the whole cell.
|
||||||
|
#[cfg_attr(debug_assertions, track_caller)]
|
||||||
pub fn col(&mut self, add_cell_contents: impl FnOnce(&mut Ui)) -> (Rect, Response) {
|
pub fn col(&mut self, add_cell_contents: impl FnOnce(&mut Ui)) -> (Rect, Response) {
|
||||||
let col_index = self.col_index;
|
let col_index = self.col_index;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue