mirror of
https://github.com/emilk/egui.git
synced 2026-08-30 13:20:05 -04:00
Remove extra_asserts and extra_debug_asserts feature flags (#4478)
Removes `egui_assert` etc and replaces it with normal `debug_assert` calls. Previously you could opt-in to more runtime checks using feature flags. Now these extra runtime checks are always enabled for debug builds. You are most likely to encounter them if you use negative sizes or NaNs or other similar bugs. These usually indicate bugs in user space.
This commit is contained in:
@@ -49,7 +49,7 @@ impl TextureManager {
|
||||
pub fn set(&mut self, id: TextureId, delta: ImageDelta) {
|
||||
if let Some(meta) = self.metas.get_mut(&id) {
|
||||
if let Some(pos) = delta.pos {
|
||||
crate::epaint_assert!(
|
||||
debug_assert!(
|
||||
pos[0] + delta.image.width() <= meta.size[0]
|
||||
&& pos[1] + delta.image.height() <= meta.size[1],
|
||||
"Partial texture update is outside the bounds of texture {id:?}",
|
||||
@@ -63,7 +63,7 @@ impl TextureManager {
|
||||
}
|
||||
self.delta.set.push((id, delta));
|
||||
} else {
|
||||
crate::epaint_assert!(false, "Tried setting texture {id:?} which is not allocated");
|
||||
debug_assert!(false, "Tried setting texture {id:?} which is not allocated");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ impl TextureManager {
|
||||
self.delta.free.push(id);
|
||||
}
|
||||
} else {
|
||||
crate::epaint_assert!(false, "Tried freeing texture {id:?} which is not allocated");
|
||||
debug_assert!(false, "Tried freeing texture {id:?} which is not allocated");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ impl TextureManager {
|
||||
if let Some(meta) = self.metas.get_mut(&id) {
|
||||
meta.retain_count += 1;
|
||||
} else {
|
||||
crate::epaint_assert!(
|
||||
debug_assert!(
|
||||
false,
|
||||
"Tried retaining texture {id:?} which is not allocated",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user