From 92fe9b95d59ffad699d5a1155f4735891420d1f0 Mon Sep 17 00:00:00 2001 From: Ryan Di Date: Tue, 21 Mar 2023 14:41:11 +0800 Subject: [PATCH] remove element stats from 'stats for nerds' --- src/components/Stats.tsx | 59 ---------------------------------------- 1 file changed, 59 deletions(-) diff --git a/src/components/Stats.tsx b/src/components/Stats.tsx index 8aad760264..7c98219bdf 100644 --- a/src/components/Stats.tsx +++ b/src/components/Stats.tsx @@ -2,7 +2,6 @@ import React from "react"; import { getCommonBounds } from "../element/bounds"; import { NonDeletedExcalidrawElement } from "../element/types"; import { t } from "../i18n"; -import { getTargetElements } from "../scene"; import { AppState, ExcalidrawProps } from "../types"; import { CloseIcon } from "./icons"; import { Island } from "./Island"; @@ -16,8 +15,6 @@ export const Stats = (props: { renderCustomStats: ExcalidrawProps["renderCustomStats"]; }) => { const boundingBox = getCommonBounds(props.elements); - const selectedElements = getTargetElements(props.elements, props.appState); - const selectedBoundingBox = getCommonBounds(selectedElements); return (
@@ -43,62 +40,6 @@ export const Stats = (props: { {t("stats.height")} {Math.round(boundingBox[3]) - Math.round(boundingBox[1])} - - {selectedElements.length === 1 && ( - - {t("stats.element")} - - )} - - {selectedElements.length > 1 && ( - <> - - {t("stats.selected")} - - - {t("stats.elements")} - {selectedElements.length} - - - )} - {selectedElements.length > 0 && ( - <> - - {"x"} - {Math.round(selectedBoundingBox[0])} - - - {"y"} - {Math.round(selectedBoundingBox[1])} - - - {t("stats.width")} - - {Math.round( - selectedBoundingBox[2] - selectedBoundingBox[0], - )} - - - - {t("stats.height")} - - {Math.round( - selectedBoundingBox[3] - selectedBoundingBox[1], - )} - - - - )} - {selectedElements.length === 1 && ( - - {t("stats.angle")} - - {`${Math.round( - (selectedElements[0].angle * 180) / Math.PI, - )}°`} - - - )} {props.renderCustomStats?.(props.elements, props.appState)}