mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-02-26 19:34:33 +00:00
Support for rounded rectangles
This commit is contained in:
parent
b59c528ece
commit
cefbc3c9be
@ -7,4 +7,6 @@
|
||||
[attr.stroke-dasharray]="stroke_dasharray"
|
||||
[attr.width]="rect.width"
|
||||
[attr.height]="rect.height"
|
||||
[attr.rx]="rect.rx"
|
||||
[attr.ry]="rect.ry"
|
||||
/>
|
||||
|
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 322 B |
@ -40,6 +40,16 @@ export class RectConverter implements SvgConverter {
|
||||
drawing.height = parseInt(height.value, 10);
|
||||
}
|
||||
|
||||
const rx = element.attributes.getNamedItem('rx');
|
||||
if (rx) {
|
||||
drawing.rx = parseInt(rx.value, 0);
|
||||
}
|
||||
|
||||
const ry = element.attributes.getNamedItem('ry');
|
||||
if (ry) {
|
||||
drawing.ry = parseInt(ry.value, 0);
|
||||
}
|
||||
|
||||
return drawing;
|
||||
}
|
||||
}
|
||||
|
@ -8,4 +8,6 @@ export class RectElement implements DrawingElement {
|
||||
stroke: string;
|
||||
stroke_width: number;
|
||||
stroke_dasharray: string;
|
||||
rx: number;
|
||||
ry: number;
|
||||
}
|
||||
|
@ -33,7 +33,9 @@ export class RectDrawingWidget implements DrawingShapeWidget {
|
||||
.attr('stroke-width', (rect) => rect.stroke_width)
|
||||
.attr('stroke-dasharray', (rect) => this.qtDasharrayFixer.fix(rect.stroke_dasharray))
|
||||
.attr('width', (rect) => rect.width)
|
||||
.attr('height', (rect) => rect.height);
|
||||
.attr('height', (rect) => rect.height)
|
||||
.attr('rx', (rect) => rect.rx)
|
||||
.attr('ry', (rect) => rect.ry);
|
||||
|
||||
drawing.exit().remove();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user