mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-06 01:01:33 +00:00
Resolve missing border style options dash dot dot and invisible for links between devices
This commit is contained in:
parent
85f60fbc1c
commit
f338a2e33d
@ -8,8 +8,8 @@ import { Drawing } from '../../../../cartography/models/drawing';
|
|||||||
import { EllipseElement } from '../../../../cartography/models/drawings/ellipse-element';
|
import { EllipseElement } from '../../../../cartography/models/drawings/ellipse-element';
|
||||||
import { LineElement } from '../../../../cartography/models/drawings/line-element';
|
import { LineElement } from '../../../../cartography/models/drawings/line-element';
|
||||||
import { RectElement } from '../../../../cartography/models/drawings/rect-element';
|
import { RectElement } from '../../../../cartography/models/drawings/rect-element';
|
||||||
import { Project } from '../../../../models/project';
|
|
||||||
import { Controller } from '../../../../models/controller';
|
import { Controller } from '../../../../models/controller';
|
||||||
|
import { Project } from '../../../../models/project';
|
||||||
import { DrawingService } from '../../../../services/drawing.service';
|
import { DrawingService } from '../../../../services/drawing.service';
|
||||||
import { ToasterService } from '../../../../services/toaster.service';
|
import { ToasterService } from '../../../../services/toaster.service';
|
||||||
import { NonNegativeValidator } from '../../../../validators/non-negative-validator';
|
import { NonNegativeValidator } from '../../../../validators/non-negative-validator';
|
||||||
@ -27,10 +27,12 @@ export class StyleEditorDialogComponent implements OnInit {
|
|||||||
element: ElementData;
|
element: ElementData;
|
||||||
formGroup: FormGroup;
|
formGroup: FormGroup;
|
||||||
borderTypes = [
|
borderTypes = [
|
||||||
{value:"none",name:"Solid"},
|
{ value: '', name: 'Invisible' },
|
||||||
{value:"5",name:"Dash"},
|
{ value: 'none', name: 'Solid' },
|
||||||
{value:"15",name:"Dot"},
|
{ value: '5', name: 'Dash' },
|
||||||
{value:"5 15",name:"Dash Dot"}
|
{ value: '15', name: 'Dot' },
|
||||||
|
{ value: '5 15', name: 'Dash Dot' },
|
||||||
|
{ value: '10 5 5', name: 'Dash Dot Dot' },
|
||||||
];
|
];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@ -55,7 +57,7 @@ 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.stroke = this.drawing.element.stroke;
|
this.element.stroke = this.drawing.element.stroke;
|
||||||
this.element.stroke_dasharray = this.drawing.element.stroke_dasharray ?? 'none'
|
this.element.stroke_dasharray = this.drawing.element.stroke_dasharray ?? 'none';
|
||||||
this.element.stroke_width = this.drawing.element.stroke_width;
|
this.element.stroke_width = this.drawing.element.stroke_width;
|
||||||
} else if (this.drawing.element instanceof LineElement) {
|
} else if (this.drawing.element instanceof LineElement) {
|
||||||
this.element.stroke = this.drawing.element.stroke;
|
this.element.stroke = this.drawing.element.stroke;
|
||||||
@ -74,7 +76,11 @@ export class StyleEditorDialogComponent implements OnInit {
|
|||||||
|
|
||||||
onYesClick() {
|
onYesClick() {
|
||||||
if (this.formGroup.valid) {
|
if (this.formGroup.valid) {
|
||||||
this.element.stroke_width = this.formGroup.get('borderWidth').value;
|
if (this.element.stroke_dasharray == '') {
|
||||||
|
this.element.stroke_width = 0;
|
||||||
|
} else {
|
||||||
|
this.element.stroke_width = this.formGroup.get('borderWidth').value === 0 ? 2 : this.formGroup.get('borderWidth').value
|
||||||
|
}
|
||||||
this.drawing.rotation = this.formGroup.get('rotation').value;
|
this.drawing.rotation = this.formGroup.get('rotation').value;
|
||||||
|
|
||||||
if (this.drawing.element instanceof RectElement || this.drawing.element instanceof EllipseElement) {
|
if (this.drawing.element instanceof RectElement || this.drawing.element instanceof EllipseElement) {
|
||||||
@ -84,8 +90,8 @@ export class StyleEditorDialogComponent implements OnInit {
|
|||||||
this.drawing.element.stroke_width = this.element.stroke_width;
|
this.drawing.element.stroke_width = this.element.stroke_width;
|
||||||
} else if (this.drawing.element instanceof LineElement) {
|
} else if (this.drawing.element instanceof LineElement) {
|
||||||
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 === '' ? 'none': this.element.stroke_dasharray ;
|
||||||
this.drawing.element.stroke_width = this.element.stroke_width;
|
this.drawing.element.stroke_width = this.element.stroke_width === 0 ? 2 :this.element.stroke_width;
|
||||||
}
|
}
|
||||||
let mapDrawing = this.drawingToMapDrawingConverter.convert(this.drawing);
|
let mapDrawing = this.drawingToMapDrawingConverter.convert(this.drawing);
|
||||||
mapDrawing.element = this.drawing.element;
|
mapDrawing.element = this.drawing.element;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user