Allow edit height and width for rectangles and ellipses

This commit is contained in:
grossmj 2023-10-24 18:23:55 +10:00
parent a4f7db62ba
commit d725363fe5
2 changed files with 29 additions and 0 deletions

View File

@ -42,6 +42,29 @@
/> />
</mat-form-field> </mat-form-field>
<mat-form-field class="form-field" *ngIf="element.width !== undefined">
<input
matInput
[ngModelOptions]="{ standalone: true }"
placeholder="Width"
min="0"
type="number"
[(ngModel)]="element.width"
/>
</mat-form-field>
<mat-form-field class="form-field" *ngIf="element.height !== undefined">
<input
matInput
[ngModelOptions]="{ standalone: true }"
placeholder="Height"
min="0"
type="number"
[(ngModel)]="element.height"
/>
</mat-form-field>
<mat-form-field class="form-field" *ngIf="element.rx !== undefined"> <mat-form-field class="form-field" *ngIf="element.rx !== undefined">
<input <input
matInput matInput

View File

@ -49,6 +49,8 @@ export class StyleEditorDialogComponent implements OnInit {
if (this.drawing.element instanceof RectElement || this.drawing.element instanceof EllipseElement) { if (this.drawing.element instanceof RectElement || this.drawing.element instanceof EllipseElement) {
this.element.fill = this.drawing.element.fill; this.element.fill = this.drawing.element.fill;
this.element.width = this.drawing.element.width;
this.element.height = this.drawing.element.height;
this.element.stroke = this.drawing.element.stroke; this.element.stroke = this.drawing.element.stroke;
this.element.stroke_dasharray = this.drawing.element.stroke_dasharray; this.element.stroke_dasharray = this.drawing.element.stroke_dasharray;
this.element.stroke_width = this.drawing.element.stroke_width; this.element.stroke_width = this.drawing.element.stroke_width;
@ -79,6 +81,8 @@ export class StyleEditorDialogComponent implements OnInit {
if (this.drawing.element instanceof RectElement || this.drawing.element instanceof EllipseElement) { if (this.drawing.element instanceof RectElement || this.drawing.element instanceof EllipseElement) {
this.drawing.element.fill = this.element.fill; this.drawing.element.fill = this.element.fill;
this.drawing.element.width = this.element.width;
this.drawing.element.height = this.element.height;
this.drawing.element.stroke = this.element.stroke; this.drawing.element.stroke = this.element.stroke;
this.drawing.element.stroke_dasharray = this.element.stroke_dasharray; this.drawing.element.stroke_dasharray = this.element.stroke_dasharray;
this.drawing.element.stroke_width = this.element.stroke_width; this.drawing.element.stroke_width = this.element.stroke_width;
@ -110,6 +114,8 @@ export class StyleEditorDialogComponent implements OnInit {
export class ElementData { export class ElementData {
fill: string; fill: string;
width: number;
height: number;
stroke: string; stroke: string;
stroke_width: number; stroke_width: number;
stroke_dasharray: string; stroke_dasharray: string;