From a5ecd75a53501e1147bb784d8e4359ec1edc7cf8 Mon Sep 17 00:00:00 2001 From: minlovehua <321512939@qq.com> Date: Thu, 3 Aug 2023 15:21:14 +0800 Subject: [PATCH] feat: remove the redundant white border #INFR-9002 --- packages/gantt/src/components/bar/bar.component.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/gantt/src/components/bar/bar.component.ts b/packages/gantt/src/components/bar/bar.component.ts index 93c14b06..0a6d471c 100644 --- a/packages/gantt/src/components/bar/bar.component.ts +++ b/packages/gantt/src/components/bar/bar.component.ts @@ -125,17 +125,25 @@ export class NgxGanttBarComponent extends GanttItemUpper implements OnInit, Afte const contentElement = this.contentElementRef.nativeElement; const color = this.item.color || barBackground; const style: Partial = this.item.barStyle || {}; + const barElement = this.elementRef.nativeElement; + if (this.item.origin.start && this.item.origin.end) { style.background = color; style.borderRadius = ''; } if (this.item.origin.start && !this.item.origin.end) { style.background = linearGradient('to left', hexToRgb(color, 0.55), hexToRgb(color, 1)); - style.borderRadius = '4px 12.5px 12.5px 4px'; + + const borderRadius = '4px 12.5px 12.5px 4px'; + style.borderRadius = borderRadius; + barElement.style.borderRadius = borderRadius; } if (!this.item.origin.start && this.item.origin.end) { style.background = linearGradient('to right', hexToRgb(color, 0.55), hexToRgb(color, 1)); - style.borderRadius = '12.5px 4px 4px 12.5px'; + + const borderRadius = '12.5px 4px 4px 12.5px'; + style.borderRadius = borderRadius; + barElement.style.borderRadius = borderRadius; } if (this.item.progress >= 0) { const contentProgressElement = contentElement.querySelector('.gantt-bar-content-progress') as HTMLDivElement;