|
2 | 2 |
|
3 | 3 | use std::{borrow::Cow, collections::HashMap, num::NonZeroU32};
|
4 | 4 |
|
5 |
| -use egui::{epaint::Primitive, NumExt, PaintCallbackInfo}; |
| 5 | +use egui::{epaint::Primitive, PaintCallbackInfo}; |
6 | 6 | use type_map::concurrent::TypeMap;
|
7 | 7 | use wgpu;
|
8 | 8 | use wgpu::util::DeviceExt as _;
|
@@ -405,9 +405,9 @@ impl Renderer {
|
405 | 405 | let rect = ScissorRect::new(clip_rect, pixels_per_point, size_in_pixels);
|
406 | 406 |
|
407 | 407 | if rect.width == 0 || rect.height == 0 {
|
408 |
| - // Skip rendering with zero-sized clip areas. |
| 408 | + // Skip rendering zero-sized clip areas. |
409 | 409 | if let Primitive::Mesh(_) = primitive {
|
410 |
| - // If this is a mesh, we need to advance the index and vertex buffer iterators |
| 410 | + // If this is a mesh, we need to advance the index and vertex buffer iterators: |
411 | 411 | index_buffers.next().unwrap();
|
412 | 412 | vertex_buffers.next().unwrap();
|
413 | 413 | }
|
@@ -906,14 +906,11 @@ impl ScissorRect {
|
906 | 906 | let clip_max_x = clip_max_x.clamp(clip_min_x, target_size[0]);
|
907 | 907 | let clip_max_y = clip_max_y.clamp(clip_min_y, target_size[1]);
|
908 | 908 |
|
909 |
| - let width = (clip_max_x - clip_min_x).at_least(1); |
910 |
| - let height = (clip_max_y - clip_min_y).at_least(1); |
911 |
| - |
912 |
| - ScissorRect { |
| 909 | + Self { |
913 | 910 | x: clip_min_x,
|
914 | 911 | y: clip_min_y,
|
915 |
| - width, |
916 |
| - height, |
| 912 | + width: clip_max_x - clip_min_x, |
| 913 | + height: clip_max_y - clip_min_y, |
917 | 914 | }
|
918 | 915 | }
|
919 | 916 | }
|
|
0 commit comments