mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
do not center text when not applicable (#1783)
This commit is contained in:
parent
9c89504b6f
commit
cd87bd6901
16 changed files with 418 additions and 321 deletions
|
@ -2,6 +2,7 @@ import { ExcalidrawElement } from "./element/types";
|
|||
import { newElement, newTextElement } from "./element";
|
||||
import { AppState } from "./types";
|
||||
import { t } from "./i18n";
|
||||
import { DEFAULT_VERTICAL_ALIGN } from "./constants";
|
||||
|
||||
interface Spreadsheet {
|
||||
yAxisLabel: string | null;
|
||||
|
@ -167,6 +168,7 @@ export function renderSpreadsheet(
|
|||
fontSize: 16,
|
||||
fontFamily: appState.currentItemFontFamily,
|
||||
textAlign: appState.currentItemTextAlign,
|
||||
verticalAlign: DEFAULT_VERTICAL_ALIGN,
|
||||
});
|
||||
|
||||
const maxYLabel = newTextElement({
|
||||
|
@ -183,6 +185,7 @@ export function renderSpreadsheet(
|
|||
fontSize: 16,
|
||||
fontFamily: appState.currentItemFontFamily,
|
||||
textAlign: appState.currentItemTextAlign,
|
||||
verticalAlign: DEFAULT_VERTICAL_ALIGN,
|
||||
});
|
||||
|
||||
const bars = spreadsheet.values.map((value, i) => {
|
||||
|
@ -226,6 +229,7 @@ export function renderSpreadsheet(
|
|||
fontSize: 16,
|
||||
fontFamily: appState.currentItemFontFamily,
|
||||
textAlign: "center",
|
||||
verticalAlign: DEFAULT_VERTICAL_ALIGN,
|
||||
width: BAR_WIDTH,
|
||||
angle: ANGLE,
|
||||
});
|
||||
|
@ -246,6 +250,7 @@ export function renderSpreadsheet(
|
|||
fontSize: 20,
|
||||
fontFamily: appState.currentItemFontFamily,
|
||||
textAlign: "center",
|
||||
verticalAlign: DEFAULT_VERTICAL_ALIGN,
|
||||
width: BAR_WIDTH,
|
||||
angle: ANGLE,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue