Skip to content

Commit

Permalink
Merge branch '2.2' into master-3.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json
#	src/app/components/project-map/drawings-editors/style-editor/style-editor.component.ts
  • Loading branch information
grossmj committed Oct 24, 2023
2 parents dbcb8a8 + d725363 commit 3df22bd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,29 @@ <h1 mat-dialog-title>Style editor</h1>
</mat-select>
</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">
<input
matInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export class StyleEditorDialogComponent implements OnInit {
this.element = new ElementData();
if (this.drawing.element instanceof RectElement || this.drawing.element instanceof EllipseElement) {
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;
console.log(this.drawing.element.stroke_dasharray, this.drawing.element.stroke_width)
this.element.stroke_dasharray = (this.drawing.element.stroke_dasharray == undefined && this.drawing.element.stroke_width == undefined ) ? '': this.drawing.element.stroke_dasharray ?? 'none' ;
Expand Down Expand Up @@ -95,6 +97,8 @@ export class StyleEditorDialogComponent implements OnInit {

if (this.drawing.element instanceof RectElement || this.drawing.element instanceof EllipseElement) {
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 ?? "#000000";
this.drawing.element.stroke_dasharray = this.element.stroke_dasharray;
this.drawing.element.stroke_width = this.element.stroke_width;
Expand Down Expand Up @@ -133,6 +137,8 @@ export class StyleEditorDialogComponent implements OnInit {

export class ElementData {
fill: string;
width: number;
height: number;
stroke: string;
stroke_width: number;
stroke_dasharray: string;
Expand Down

0 comments on commit 3df22bd

Please sign in to comment.