mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
rename to getLineHeight and use the same line height for regular text elements
This commit is contained in:
parent
91f6e87317
commit
0e54994187
5 changed files with 21 additions and 30 deletions
|
@ -39,7 +39,7 @@ import {
|
|||
} from "../constants";
|
||||
import { getStroke, StrokeOptions } from "perfect-freehand";
|
||||
import {
|
||||
getApproxLineHeight,
|
||||
getLineHeight,
|
||||
getBoundTextElement,
|
||||
getContainerElement,
|
||||
} from "../element/textElement";
|
||||
|
@ -276,7 +276,7 @@ const drawElementOnCanvas = (
|
|||
// Canvas does not support multiline text by default
|
||||
const lines = element.text.replace(/\r\n?/g, "\n").split("\n");
|
||||
const lineHeight = element.containerId
|
||||
? getApproxLineHeight(getFontString(element))
|
||||
? getLineHeight(getFontString(element))
|
||||
: element.height / lines.length;
|
||||
const horizontalOffset =
|
||||
element.textAlign === "center"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue