Give the graphic types the serving lifetime

This commit is contained in:
Dennis Kobert
2026-08-28 13:30:06 +00:00
parent 1ef7c9c2c2
commit 25f49e8750
11 changed files with 157 additions and 134 deletions

View File

@@ -312,7 +312,7 @@ impl<T: TableItemLayout> TableItemLayout for List<T> {
}
}
impl TableItemLayout for Artboard {
impl TableItemLayout for Artboard<'_> {
fn type_name() -> &'static str {
"Artboard"
}
@@ -328,7 +328,7 @@ impl TableItemLayout for Artboard {
}
}
impl TableItemLayout for Graphic {
impl TableItemLayout for Graphic<'_> {
fn type_name() -> &'static str {
"Graphic"
}

View File

@@ -248,11 +248,11 @@ pub enum DocumentMessage {
// `UpdateFillAttributes` and `UpdateStrokeAttributes` are produced inside `editor.handle_message` by `node_graph_executor.rs` and consumed in the same dispatch loop, so it never reaches that serialization point.
#[serde(skip)]
UpdateFillAttributes {
fill_attributes: HashMap<NodeId, Arc<List<Graphic>>>,
fill_attributes: HashMap<NodeId, Arc<List<Graphic<'static>>>>,
},
#[serde(skip)]
UpdateStrokeAttributes {
stroke_attributes: HashMap<NodeId, Arc<List<Graphic>>>,
stroke_attributes: HashMap<NodeId, Arc<List<Graphic<'static>>>>,
},
Undo,
UngroupSelectedLayers,

View File

@@ -43,10 +43,10 @@ pub struct DocumentMetadata {
pub layer_vector_data: HashMap<LayerNodeIdentifier, Arc<Vector>>,
/// Per-layer `ATTR_FILL` attribute, exposed so message handlers can read paint
/// information that lives on the list.
pub layer_fill_attributes: HashMap<LayerNodeIdentifier, Arc<List<Graphic>>>,
pub layer_fill_attributes: HashMap<LayerNodeIdentifier, Arc<List<Graphic<'static>>>>,
/// Per-layer `ATTR_STROKE` attribute, exposed so message handlers can read
/// stroke paint information that lives on the list.
pub layer_stroke_attributes: HashMap<LayerNodeIdentifier, Arc<List<Graphic>>>,
pub layer_stroke_attributes: HashMap<LayerNodeIdentifier, Arc<List<Graphic<'static>>>>,
/// Transform from document space to viewport space.
pub document_to_viewport: DAffine2,
}

View File

@@ -3440,12 +3440,12 @@ impl NodeNetworkInterface {
}
/// Update the per-layer `ATTR_FILL` snapshot.
pub fn update_fill_attributes(&mut self, new_layer_fill_attributes: HashMap<LayerNodeIdentifier, Arc<List<Graphic>>>) {
pub fn update_fill_attributes(&mut self, new_layer_fill_attributes: HashMap<LayerNodeIdentifier, Arc<List<Graphic<'static>>>>) {
self.document_metadata.layer_fill_attributes = new_layer_fill_attributes;
}
/// Update the per-layer `ATTR_STROKE` snapshot.
pub fn update_stroke_attributes(&mut self, new_layer_stroke_attributes: HashMap<LayerNodeIdentifier, Arc<List<Graphic>>>) {
pub fn update_stroke_attributes(&mut self, new_layer_stroke_attributes: HashMap<LayerNodeIdentifier, Arc<List<Graphic<'static>>>>) {
self.document_metadata.layer_stroke_attributes = new_layer_stroke_attributes;
}
}

View File

@@ -618,7 +618,7 @@ impl NodeRuntime {
/// Returns the union of the artboards' clipping rectangles, used as the thumbnail bounds for an artboard layer so the
/// framing matches what's actually visible after clipping rather than the unclipped content extents.
fn artboard_clip_bounds<S: graphene_std::core_types::lane::LaneSource<Element = Artboard>>(artboards: &S) -> RenderBoundingBox {
fn artboard_clip_bounds<'a, S: graphene_std::core_types::lane::LaneSource<Element = Artboard<'a>>>(artboards: &S) -> RenderBoundingBox {
use graphene_std::core_types::attribute::{Dimensions, Location};
let mut combined: Option<[DVec2; 2]> = None;
for index in 0..artboards.lane_count() {