mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 06:40:06 -04:00
[culling] Add debug option to ignore clip rectangles
This commit is contained in:
@@ -617,11 +617,21 @@ impl Context {
|
|||||||
|
|
||||||
impl paint::PaintOptions {
|
impl paint::PaintOptions {
|
||||||
pub fn ui(&mut self, ui: &mut Ui) {
|
pub fn ui(&mut self, ui: &mut Ui) {
|
||||||
|
let Self {
|
||||||
|
anti_alias,
|
||||||
|
aa_size: _,
|
||||||
|
debug_paint_clip_rects,
|
||||||
|
debug_ignore_clip_rects,
|
||||||
|
} = self;
|
||||||
use crate::widgets::*;
|
use crate::widgets::*;
|
||||||
ui.add(Checkbox::new(&mut self.anti_alias, "Antialias"));
|
ui.add(Checkbox::new(anti_alias, "Antialias"));
|
||||||
ui.add(Checkbox::new(
|
ui.add(Checkbox::new(
|
||||||
&mut self.debug_paint_clip_rects,
|
debug_paint_clip_rects,
|
||||||
"Paint Clip Rects (debug)",
|
"Paint clip rectangles (debug)",
|
||||||
|
));
|
||||||
|
ui.add(Checkbox::new(
|
||||||
|
debug_ignore_clip_rects,
|
||||||
|
"Ignore clip rectangles (debug)",
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -438,6 +438,8 @@ pub struct PaintOptions {
|
|||||||
pub aa_size: f32,
|
pub aa_size: f32,
|
||||||
/// Output the clip rectangles to be painted?
|
/// Output the clip rectangles to be painted?
|
||||||
pub debug_paint_clip_rects: bool,
|
pub debug_paint_clip_rects: bool,
|
||||||
|
/// If true, no clipping will be done
|
||||||
|
pub debug_ignore_clip_rects: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for PaintOptions {
|
impl Default for PaintOptions {
|
||||||
@@ -446,6 +448,7 @@ impl Default for PaintOptions {
|
|||||||
anti_alias: true,
|
anti_alias: true,
|
||||||
aa_size: 1.0,
|
aa_size: 1.0,
|
||||||
debug_paint_clip_rects: false,
|
debug_paint_clip_rects: false,
|
||||||
|
debug_ignore_clip_rects: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -829,5 +832,11 @@ pub fn tessellate_paint_commands(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if options.debug_ignore_clip_rects {
|
||||||
|
for (clip_rect, _) in &mut jobs {
|
||||||
|
*clip_rect = Rect::everything();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
jobs
|
jobs
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user