overflow: hidden/scroll scissor support, remove depth

This commit is contained in:
Aleksander
2025-09-25 23:21:11 +02:00
parent 8f75d451e4
commit eb12a6a319
28 changed files with 299 additions and 182 deletions

View File

@@ -121,7 +121,6 @@ impl WidgetObj for WidgetLabel {
state.primitives.push(drawing::RenderPrimitive::Text(
PrimitiveExtent {
boundary,
depth: state.depth,
transform: state.transform_stack.get().transform,
},
self.buffer.clone(),

View File

@@ -10,7 +10,7 @@ use crate::{
EventListenerVec, MouseWheelEvent,
},
layout::{Layout, LayoutState, WidgetID},
transform_stack::TransformStack,
stack::{ScissorStack, TransformStack},
};
pub mod div;
@@ -100,7 +100,7 @@ pub struct DrawState<'a> {
pub layout: &'a Layout,
pub primitives: &'a mut Vec<RenderPrimitive>,
pub transform_stack: &'a mut TransformStack,
pub depth: f32, //TODO: actually use this in shader
pub scissor_stack: &'a mut ScissorStack,
}
// per-widget draw params
@@ -253,7 +253,6 @@ impl WidgetState {
),
Vec2::new(transform.dim.x * info.handle_size.x, thickness),
),
depth: state.depth,
transform: transform.transform,
},
rect_params,
@@ -271,7 +270,6 @@ impl WidgetState {
),
Vec2::new(thickness, transform.dim.y * info.handle_size.y),
),
depth: state.depth,
transform: transform.transform,
},
rect_params,

View File

@@ -46,7 +46,6 @@ impl WidgetObj for WidgetRectangle {
state.primitives.push(drawing::RenderPrimitive::Rectangle(
PrimitiveExtent {
boundary,
depth: state.depth,
transform: state.transform_stack.get().transform,
},
drawing::Rectangle {

View File

@@ -58,7 +58,6 @@ impl WidgetObj for WidgetSprite {
state.primitives.push(drawing::RenderPrimitive::Sprite(
PrimitiveExtent {
boundary,
depth: state.depth,
transform: state.transform_stack.get().transform,
},
Some(glyph),
@@ -79,12 +78,11 @@ impl WidgetObj for WidgetSprite {
state.primitives.push(drawing::RenderPrimitive::Text(
PrimitiveExtent {
boundary,
depth: state.depth,
transform: state.transform_stack.get().transform,
},
Rc::new(RefCell::new(buffer)),
))
};
));
}
}
fn measure(