Skip to content

Commit

Permalink
feat: remove the redundant white border at gantt bar #INFR-9002
Browse files Browse the repository at this point in the history
  • Loading branch information
minlovehua authored Aug 3, 2023
2 parents 6362a11 + a5ecd75 commit 47da959
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/gantt/src/components/bar/bar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<CSSStyleDeclaration> = 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;
Expand Down

0 comments on commit 47da959

Please sign in to comment.