1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

[epaint] Replace tuple (Rect, Shape) with tuple-struct ClippedShape

This commit is contained in:
Emil Ernerfeldt
2021-01-17 01:35:14 +01:00
parent 7b318887ee
commit 8598c365a1
7 changed files with 37 additions and 27 deletions

View File

@@ -1,4 +1,4 @@
use {crate::*, emath::*};
use crate::*;
#[derive(Clone, Copy, PartialEq)]
enum ElementSize {
@@ -146,13 +146,13 @@ pub struct PaintStats {
}
impl PaintStats {
pub fn from_shapes(shapes: &[(Rect, Shape)]) -> Self {
pub fn from_shapes(shapes: &[ClippedShape]) -> Self {
let mut stats = Self::default();
stats.shape_path.element_size = ElementSize::Heterogenous; // nicer display later
stats.shape_vec.element_size = ElementSize::Heterogenous; // nicer display later
stats.shapes = AllocInfo::from_slice(shapes);
for (_, shape) in shapes {
for ClippedShape(_, shape) in shapes {
stats.add(shape);
}
stats