mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat/ability to change the alignment of the text (#1213)
* feat: add the ability to change the alignement of the text * test: update the snapshots to included the newely textAlign state * style: use explicit key assignment to object * test: add missing new key textAlign to newElement.test.ts * style: make the text on the buttons start with uppercase * Update src/locales/en.json * add types * add migration * remove incorrect update Co-authored-by: Youness Fkhach <younessfkhach@porotonmail.com> Co-authored-by: Lipis <lipiridis@gmail.com> Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
parent
3fd6f3023f
commit
ff82d1cfa3
15 changed files with 357 additions and 9 deletions
|
@ -56,6 +56,8 @@ export function SelectedShapeActions({
|
|||
{renderAction("changeFontSize")}
|
||||
|
||||
{renderAction("changeFontFamily")}
|
||||
|
||||
{renderAction("changeTextAlign")}
|
||||
</>
|
||||
)}
|
||||
|
||||
|
|
|
@ -714,6 +714,7 @@ export class App extends React.Component<any, AppState> {
|
|||
opacity: this.state.currentItemOpacity,
|
||||
text: text,
|
||||
font: this.state.currentItemFont,
|
||||
textAlign: this.state.currentItemTextAlign,
|
||||
});
|
||||
|
||||
globalSceneState.replaceAllElements([
|
||||
|
@ -1217,6 +1218,7 @@ export class App extends React.Component<any, AppState> {
|
|||
opacity: element.opacity,
|
||||
font: element.font,
|
||||
angle: element.angle,
|
||||
textAlign: element.textAlign,
|
||||
zoom: this.state.zoom,
|
||||
onChange: withBatchedUpdates((text) => {
|
||||
if (text) {
|
||||
|
@ -1288,6 +1290,7 @@ export class App extends React.Component<any, AppState> {
|
|||
opacity: this.state.currentItemOpacity,
|
||||
text: "",
|
||||
font: this.state.currentItemFont,
|
||||
textAlign: this.state.currentItemTextAlign,
|
||||
});
|
||||
|
||||
this.setState({ editingElement: element });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue