mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-02-28 12:10:06 +00:00
Change 'Dash Dot' and 'Dash Dot Dot' border styles
This commit is contained in:
parent
3fa923a9d1
commit
20bd0733f2
@ -9,8 +9,8 @@ export class QtDasharrayFixer {
|
|||||||
static MAPPING = {
|
static MAPPING = {
|
||||||
'25, 25': '10, 2', // Dash
|
'25, 25': '10, 2', // Dash
|
||||||
'5, 25': '4, 2', // Dot
|
'5, 25': '4, 2', // Dot
|
||||||
'5, 25, 25': '5, 5, 1, 5', // Dash Dot
|
'5, 25, 25': '12, 3, 5, 3', // Dash Dot
|
||||||
'25, 25, 5, 25, 5': '5, 2, 5, 2, 5', // Dash Dot Dot
|
'25, 25, 5, 25, 5': '12, 3, 5, 3, 5, 3', // Dash Dot Dot
|
||||||
};
|
};
|
||||||
|
|
||||||
public fix(dasharray: string): string {
|
public fix(dasharray: string): string {
|
||||||
|
@ -31,8 +31,8 @@ export class StyleEditorDialogComponent implements OnInit {
|
|||||||
{ qt: 'none', value: 'none', name: 'Solid' },
|
{ qt: 'none', value: 'none', name: 'Solid' },
|
||||||
{ qt: '10, 2', value: '25, 25', name: 'Dash' },
|
{ qt: '10, 2', value: '25, 25', name: 'Dash' },
|
||||||
{ qt: '4, 2', value: '5, 25', name: 'Dot' },
|
{ qt: '4, 2', value: '5, 25', name: 'Dot' },
|
||||||
{ qt: '5, 5, 1, 5', value: '5, 25, 25', name: 'Dash Dot' },
|
{ qt: '12, 3, 5, 3', value: '5, 25, 25', name: 'Dash Dot' },
|
||||||
{ qt: '5, 2, 5, 2, 5', value: '25, 25, 5, 25, 5', name: 'Dash Dot Dot' },
|
{ qt: '12, 3, 5, 3, 5, 3', value: '25, 25, 5, 25, 5', name: 'Dash Dot Dot' },
|
||||||
{ qt: '', value: '', name: 'No border' },
|
{ qt: '', value: '', name: 'No border' },
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ export class StyleEditorDialogComponent implements OnInit {
|
|||||||
this.element = new ElementData();
|
this.element = new ElementData();
|
||||||
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;
|
||||||
console.log(this.drawing.element.stroke_dasharray, this.drawing.element.stroke_width)
|
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' ;
|
this.element.stroke_dasharray = (this.drawing.element.stroke_dasharray == undefined && this.drawing.element.stroke_width == undefined ) ? '': this.drawing.element.stroke_dasharray ?? 'none' ;
|
||||||
this.element.stroke_width = this.drawing.element.stroke_width;
|
this.element.stroke_width = this.drawing.element.stroke_width;
|
||||||
@ -97,7 +97,7 @@ export class StyleEditorDialogComponent implements OnInit {
|
|||||||
if (this.element.stroke_dasharray != '') {
|
if (this.element.stroke_dasharray != '') {
|
||||||
this.drawing.element.stroke = this.element.stroke ?? "#000000";
|
this.drawing.element.stroke = this.element.stroke ?? "#000000";
|
||||||
this.drawing.element.stroke_dasharray = this.element.stroke_dasharray === '' ? 'none' : 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 === 0 ? 2 : this.element.stroke_width;
|
this.drawing.element.stroke_width = this.element.stroke_width === 0 ? 2 : this.element.stroke_width;
|
||||||
} else {
|
} else {
|
||||||
this.toasterService.warning(`No border style line element not supported`);
|
this.toasterService.warning(`No border style line element not supported`);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user