working scissor proof of concept

This commit is contained in:
Aleksander
2025-09-24 21:53:43 +02:00
parent 8d41d8bbd1
commit 8f75d451e4
11 changed files with 175 additions and 146 deletions

View File

@@ -5,7 +5,7 @@ use slotmap::Key;
use taffy::AvailableSpace;
use crate::{
drawing::{self, Boundary},
drawing::{self, Boundary, PrimitiveExtent},
event::CallbackDataCommon,
globals::Globals,
i18n::{I18n, Translation},
@@ -118,12 +118,14 @@ impl WidgetObj for WidgetLabel {
buffer.set_size(&mut font_system, Some(boundary.size.x), Some(boundary.size.y));
}
state.primitives.push(drawing::RenderPrimitive {
boundary,
depth: state.depth,
payload: drawing::PrimitivePayload::Text(self.buffer.clone()),
transform: state.transform_stack.get().transform,
});
state.primitives.push(drawing::RenderPrimitive::Text(
PrimitiveExtent {
boundary,
depth: state.depth,
transform: state.transform_stack.get().transform,
},
self.buffer.clone(),
));
}
fn measure(