mirror of
https://github.com/penpot/penpot.git
synced 2025-07-31 01:28:32 +02:00
🐛 Fix update canvas background color
This commit is contained in:
parent
4189d01844
commit
2b95e6b7a9
3 changed files with 24 additions and 0 deletions
|
@ -138,3 +138,26 @@ test("Renders shapes with exif rotated images fills and strokes", async ({
|
|||
|
||||
await expect(workspace.canvas).toHaveScreenshot();
|
||||
});
|
||||
|
||||
test("Updates canvas background", async ({
|
||||
page,
|
||||
}) => {
|
||||
const workspace = new WasmWorkspacePage(page);
|
||||
await workspace.setupEmptyFile();
|
||||
await workspace.mockGetFile("render-wasm/get-file-text.json");
|
||||
|
||||
await workspace.goToWorkspace({
|
||||
id: "3b0d758a-8c9d-8013-8006-52c8337e5c72",
|
||||
pageId: "3b0d758a-8c9d-8013-8006-52c8337e5c73",
|
||||
});
|
||||
await workspace.waitForFirstRender({ hideUI: false });
|
||||
|
||||
const canvasBackgroundInput = workspace.page.getByRole("textbox", { name: 'Color' });
|
||||
await canvasBackgroundInput.fill("FABADA");
|
||||
await workspace.page.keyboard.press("Enter");
|
||||
|
||||
// can't hide UI cause this will trigger a re-render
|
||||
// await workspace.hideUI();
|
||||
|
||||
await expect(workspace.canvas).toHaveScreenshot();
|
||||
});
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
|
@ -115,6 +115,7 @@ pub extern "C" fn set_canvas_background(raw_color: u32) {
|
|||
with_state_mut!(state, {
|
||||
let color = skia::Color::new(raw_color);
|
||||
state.set_background_color(color);
|
||||
state.rebuild_tiles();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue