mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
🐛 Fix line-height rendering on empty lines
This commit is contained in:
134
frontend/playwright/data/render-wasm/get-file-empty-lines.json
Normal file
134
frontend/playwright/data/render-wasm/get-file-empty-lines.json
Normal file
File diff suppressed because one or more lines are too long
@@ -367,6 +367,26 @@ test("Renders a file with texts with tabs", async ({
|
||||
await expect(workspace.canvas).toHaveScreenshot();
|
||||
});
|
||||
|
||||
test("Renders a file with texts with empty lines", async ({
|
||||
page,
|
||||
}) => {
|
||||
const workspace = new WasmWorkspacePage(page);
|
||||
await workspace.setupEmptyFile();
|
||||
await workspace.mockGetFile("render-wasm/get-file-empty-lines.json");
|
||||
|
||||
await workspace.goToWorkspace({
|
||||
id: "58c5cc60-d124-81bd-8007-0ecbaf9da983",
|
||||
pageId: "15222a7a-d3bc-80f1-8007-0d8e166e650f",
|
||||
});
|
||||
|
||||
await workspace.waitForFirstRender({ hideUI: false });
|
||||
await workspace.clickLeafLayer("text-with-empty-lines-2");
|
||||
await workspace.hideUI();
|
||||
await workspace.page.keyboard.press("Enter");
|
||||
|
||||
await expect(workspace.canvas).toHaveScreenshot();
|
||||
});
|
||||
|
||||
test.skip("Updates text alignment edition - part 1", async ({ page }) => {
|
||||
const workspace = new WasmWorkspacePage(page);
|
||||
await workspace.setupEmptyFile();
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 44 KiB |
@@ -39,11 +39,6 @@
|
||||
line-break: auto;
|
||||
line-height: inherit;
|
||||
caret-color: var(--text-editor-caret-color);
|
||||
|
||||
// firefox-only
|
||||
white-space: preserve-spaces;
|
||||
|
||||
// others
|
||||
white-space-collapse: pre;
|
||||
tab-size: 2;
|
||||
-o-tab-size: 2;
|
||||
|
||||
@@ -600,7 +600,6 @@ impl Paragraph {
|
||||
self.line_height
|
||||
}
|
||||
|
||||
// FIXME: move serialization to wasm module
|
||||
pub fn paragraph_to_style(&self) -> ParagraphStyle {
|
||||
let mut style = ParagraphStyle::default();
|
||||
|
||||
@@ -712,7 +711,7 @@ impl TextSpan {
|
||||
style.set_font_families(&font_families);
|
||||
style.set_font_size(self.font_size);
|
||||
style.set_letter_spacing(self.letter_spacing);
|
||||
style.set_half_leading(true);
|
||||
style.set_half_leading(false);
|
||||
|
||||
style
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user