Merge branch 'master' into mrazator/separate-element-into-standalone-package

This commit is contained in:
Marcel Mraz 2025-03-25 10:05:50 +01:00
commit e50f78e9d2
No known key found for this signature in database
GPG key ID: 4EBD6E62DC830CD2
15 changed files with 50 additions and 48 deletions

View file

@ -19,6 +19,7 @@ import {
isAnyTrue,
tupleToCoors,
getSizeFromPoints,
isDevEnv,
} from "@excalidraw/common";
import type { AppState } from "@excalidraw/excalidraw/types";
@ -254,7 +255,7 @@ const handleSegmentRenormalization = (
);
}
import.meta.env.DEV &&
isDevEnv() &&
invariant(
validateElbowPoints(nextPoints),
"Invalid elbow points with fixed segments",

View file

@ -1,4 +1,4 @@
import { ENV } from "@excalidraw/common";
import { isDevEnv, isTestEnv } from "@excalidraw/common";
import { charWidth, getLineWidth } from "./textMeasurements";
@ -562,7 +562,7 @@ const isSingleCharacter = (maybeSingleCharacter: string) => {
* Invariant for the word wrapping algorithm.
*/
const satisfiesWordInvariant = (word: string) => {
if (import.meta.env.MODE === ENV.TEST || import.meta.env.DEV) {
if (isTestEnv() || isDevEnv()) {
if (/\s/.test(word)) {
throw new Error("Word should not contain any whitespaces!");
}