Repository navigation
New node: 'Bake Footprint', with a draggable footprint cage - #5014
TrueDoctor wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
2 issues found across 20 files
Confidence score: 3/5
context.rsunconditionally inverts the supplied footprint, so a zero-sized or singular area can pass a non-finite transform into the wrapped graph. Validate the footprint transform and resolution before inversion.observations.rsdrops every vector after row 0 for multi-elementPathinputs, which can leave path overlays and editing state out of sync with rendered geometry. Preserve all list rows or normalize observations to match the rendered geometry.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="node-graph/nodes/gcore/src/context.rs">
<violation number="1" location="node-graph/nodes/gcore/src/context.rs:144">
P2: This unconditionally inverts a user-provided footprint, so a zero-sized or singular area injects a singular/non-finite transform into the wrapped graph. Validate the footprint transform and resolution before inversion and handle the invalid input with a localized failure or empty result, matching `rasterize_with_vello`.</violation>
</file>
<file name="editor/src/node_graph_executor/observations.rs">
<violation number="1" location="editor/src/node_graph_executor/observations.rs:45">
P2: This drops every vector after row 0 when a `Path` node receives a multi-element list, so the editor’s path overlays and editing state no longer match the rendered geometry. Preserve all list rows or normalize the observed value through the same ranked adapter used by the node before building the editable geometry.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| let area = footprint.into_element(); | ||
| let unit_square_to_pixels = DAffine2::from_scale(area.resolution.as_dvec2()); | ||
| let footprint = Footprint { | ||
| transform: unit_square_to_pixels * area.transform.inverse(), |
There was a problem hiding this comment.
P2: This unconditionally inverts a user-provided footprint, so a zero-sized or singular area injects a singular/non-finite transform into the wrapped graph. Validate the footprint transform and resolution before inversion and handle the invalid input with a localized failure or empty result, matching rasterize_with_vello.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At node-graph/nodes/gcore/src/context.rs, line 144:
<comment>This unconditionally inverts a user-provided footprint, so a zero-sized or singular area injects a singular/non-finite transform into the wrapped graph. Validate the footprint transform and resolution before inversion and handle the invalid input with a localized failure or empty result, matching `rasterize_with_vello`.</comment>
<file context>
@@ -96,6 +97,96 @@ fn read_index(
+ let area = footprint.into_element();
+ let unit_square_to_pixels = DAffine2::from_scale(area.resolution.as_dvec2());
+ let footprint = Footprint {
+ transform: unit_square_to_pixels * area.transform.inverse(),
+ ..area
+ };
</file context>
| let value = result.data.as_ref()?; | ||
|
|
||
| let geometry = match value.downcast_ref::<List<Vector>>() { | ||
| Some(list) => VectorGeometry::new(list.element(0).cloned().unwrap_or_default(), paths_from_list_row_attributes(list, 0).cloned().unwrap_or_default()), |
There was a problem hiding this comment.
P2: This drops every vector after row 0 when a Path node receives a multi-element list, so the editor’s path overlays and editing state no longer match the rendered geometry. Preserve all list rows or normalize the observed value through the same ranked adapter used by the node before building the editable geometry.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At editor/src/node_graph_executor/observations.rs, line 45:
<comment>This drops every vector after row 0 when a `Path` node receives a multi-element list, so the editor’s path overlays and editing state no longer match the rendered geometry. Preserve all list rows or normalize the observed value through the same ranked adapter used by the node before building the editable geometry.</comment>
<file context>
@@ -0,0 +1,51 @@
+ let value = result.data.as_ref()?;
+
+ let geometry = match value.downcast_ref::<List<Vector>>() {
+ Some(list) => VectorGeometry::new(list.element(0).cloned().unwrap_or_default(), paths_from_list_row_attributes(list, 0).cloned().unwrap_or_default()),
+ None => VectorGeometry::from_item(value.downcast_ref::<Item<Vector>>()?),
+ };
</file context>
There was a problem hiding this comment.
1 issue found across 10 files (changes from recent commits).
Confidence score: 3/5
- In
footprint_cage.rs, clamping the size can move the stationary edge when a resize crosses it, and centered drags may end up off-center. Preserve the fixed edge and recenter the clamped dimension for centered drags.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="editor/src/messages/tool/common_functionality/gizmos/footprint_cage.rs">
<violation number="1" location="editor/src/messages/tool/common_functionality/gizmos/footprint_cage.rs:143">
P2: Clamping `size` without adjusting `position` moves the stationary edge when a resize collapses past it. Preserve the fixed edge while enforcing the minimum size, and recenter the clamped dimension for centered drags.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
|
||
| let original_area = drag.original_area; | ||
| let one_pixel = original_area.resolution.as_dvec2().recip(); | ||
| let size = size.max(one_pixel); |
There was a problem hiding this comment.
P2: Clamping size without adjusting position moves the stationary edge when a resize collapses past it. Preserve the fixed edge while enforcing the minimum size, and recenter the clamped dimension for centered drags.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At editor/src/messages/tool/common_functionality/gizmos/footprint_cage.rs, line 143:
<comment>Clamping `size` without adjusting `position` moves the stationary edge when a resize collapses past it. Preserve the fixed edge while enforcing the minimum size, and recenter the clamped dimension for centered drags.</comment>
<file context>
@@ -143,6 +139,9 @@ impl FootprintCage {
let original_area = drag.original_area;
+ let one_pixel = original_area.resolution.as_dvec2().recip();
+ let size = size.max(one_pixel);
+
let area = Footprint {
</file context>
56cd1ad to
90d5c80
Compare
Add a bake transform node which sets the footprint and add a draggable cage for the footprint widget.

This also makes it possible to modify the bounds for the rasterize node via a gizmo