Change 'Dash Dot' and 'Dash Dot Dot' border styles

This commit is contained in:
grossmj 2022-08-29 19:23:48 +02:00
parent 3fa923a9d1
commit 20bd0733f2
2 changed files with 6 additions and 6 deletions

View File

@ -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 {

View File

@ -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`);
} }