Skip to content

Commit 4294224

Browse files
author
Madeline Sparkles
committed
add the current clip rect to PaintContext
1 parent 373079f commit 4294224

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

crates/yakui-core/src/paint/paint_dom.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ impl PaintDom {
110110
let context = PaintContext {
111111
dom,
112112
layout,
113+
clip: self.current_clip,
113114
paint: self,
114115
};
115116
let node = dom.get(id).unwrap();

crates/yakui-core/src/widget.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use glam::Vec2;
99
use crate::dom::Dom;
1010
use crate::event::EventResponse;
1111
use crate::event::{EventInterest, WidgetEvent};
12-
use crate::geometry::{Constraints, FlexFit};
12+
use crate::geometry::{Constraints, FlexFit, Rect};
1313
use crate::input::InputState;
1414
use crate::layout::LayoutDom;
1515
use crate::navigation::NavDirection;
@@ -48,6 +48,7 @@ pub struct PaintContext<'dom> {
4848
pub dom: &'dom Dom,
4949
pub layout: &'dom LayoutDom,
5050
pub paint: &'dom mut PaintDom,
51+
pub clip: Rect,
5152
}
5253

5354
impl PaintContext<'_> {

0 commit comments

Comments
 (0)