mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
fix: use ideographic
textBaseline to improve layout shift when editing text (#6384)
This commit is contained in:
parent
83383977f5
commit
9e52c30ce8
1 changed files with 8 additions and 1 deletions
|
@ -34,6 +34,7 @@ import { AppState, BinaryFiles, Zoom } from "../types";
|
||||||
import { getDefaultAppState } from "../appState";
|
import { getDefaultAppState } from "../appState";
|
||||||
import {
|
import {
|
||||||
BOUND_TEXT_PADDING,
|
BOUND_TEXT_PADDING,
|
||||||
|
FONT_FAMILY,
|
||||||
MAX_DECIMALS_FOR_SVG_EXPORT,
|
MAX_DECIMALS_FOR_SVG_EXPORT,
|
||||||
MIME_TYPES,
|
MIME_TYPES,
|
||||||
SVG_NS,
|
SVG_NS,
|
||||||
|
@ -286,7 +287,13 @@ const drawElementOnCanvas = (
|
||||||
: element.textAlign === "right"
|
: element.textAlign === "right"
|
||||||
? element.width
|
? element.width
|
||||||
: 0;
|
: 0;
|
||||||
context.textBaseline = "bottom";
|
|
||||||
|
// FIXME temporary hack
|
||||||
|
context.textBaseline =
|
||||||
|
element.fontFamily === FONT_FAMILY.Virgil ||
|
||||||
|
element.fontFamily === FONT_FAMILY.Cascadia
|
||||||
|
? "ideographic"
|
||||||
|
: "bottom";
|
||||||
|
|
||||||
const lineHeightPx = getLineHeightInPx(
|
const lineHeightPx = getLineHeightInPx(
|
||||||
element.fontSize,
|
element.fontSize,
|
||||||
|
|
Loading…
Add table
Reference in a new issue