From a1de7dcd2683d18f90ecfcd92fc2c31ae4c7afa2 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Tue, 10 Nov 2026 11:04:49 -0500 Subject: [PATCH] M10: Export: test a blurred pane inside a frame (#2213) The reporter's case: the pane sits in a frame over another layer. Exported on its own it keeps the blurred layer beneath it and the frame's fill behind it, opaque, as on the canvas. Co-Authored-By: Claude Opus 5.5 Model-Effort: Opus 5.5 drove and wrote --- crates/engine/src/export_behaviour_tests.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/crates/engine/src/export_behaviour_tests.rs b/crates/engine/src/export_behaviour_tests.rs index 0f2c8f3de..3297b7ad3 100644 --- a/crates/engine/src/export_behaviour_tests.rs +++ b/crates/engine/src/export_behaviour_tests.rs @@ -422,6 +422,25 @@ fn exporting_a_background_blur_layer_keeps_the_blurred_backdrop() { assert_eq!(exported.dimensions(), (120, 80), "the pane's own bounds"); } +/// #2213, as reported and as measured in Figma (2026-11-10): the pane inside a frame, exported on +/// its own, keeps the frame's fill and the blurred layer beneath it, opaque. +#[test] +fn a_blurred_pane_inside_a_frame_keeps_the_frame_and_the_layer_beneath() { + use figcraft_doc::{Document, NodeKind}; + let mut d = Document::new("blur-export-frame"); + let page = d.first_page().unwrap(); + let art = d.create(page, NodeKind::Frame, "Art", 0.0, 0.0, 300.0, 200.0).unwrap(); + d.get_mut(art).unwrap().fills = vec![figcraft_color::Paint::solid(figcraft_color::Color::from_hex("FFFFFF").unwrap())]; + let under = d.create(art, NodeKind::Rectangle, "Under", 0.0, 0.0, 120.0, 120.0).unwrap(); + d.get_mut(under).unwrap().fills = vec![figcraft_color::Paint::solid(figcraft_color::Color::from_hex("E03030").unwrap())]; + let pane = d.create(art, NodeKind::Rectangle, "Glass", 60.0, 20.0, 120.0, 80.0).unwrap(); + d.get_mut(pane).unwrap().fills = vec![]; + d.get_mut(pane).unwrap().effects = vec![Effect { kind: EffectKind::BackgroundBlur(figcraft_doc::Blur::uniform(12.0)), visible: true }]; + let (exported, canvas) = export_vs_canvas(&d, &[pane]); + assert_eq!(exported.get_pixel(60, 40), canvas.get_pixel(60, 40), "the blurred square under the pane"); + assert_eq!(exported.get_pixel(100, 40).0[3], 255, "the frame's white behind the pane, opaque"); +} + /// #2213: the same for Glass. #[test] fn exporting_a_glass_layer_keeps_the_backdrop_it_bends() {