Skip to content

Commit

Permalink
Fix up issue with drilldown cells having bad rendering when too small
Browse files Browse the repository at this point in the history
  • Loading branch information
jassmith committed Mar 17, 2022
1 parent ea734a1 commit ec41159
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions packages/core/src/data-grid/data-grid-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ function getAndCacheDrilldownBorder(
ctx.fillStyle = bgCell;
ctx.fill();

ctx.shadowColor = "rgba(24, 25, 34, 0.4)";
ctx.shadowColor = "rgba(24, 25, 34, 0.3)";
ctx.shadowOffsetY = 1;
ctx.shadowBlur = 5;
ctx.fillStyle = bgCell;
Expand Down Expand Up @@ -659,9 +659,21 @@ export function drawDrilldownCell(args: BaseDrawArgs, data: readonly DrilldownCe
const rx = Math.floor(rectInfo.x);
const rw = Math.floor(rectInfo.width);
ctx.imageSmoothingEnabled = false;
ctx.drawImage(el, 0, 0, sideWidth, height, rx - 5, y + h / 2 - 17, 17, 34);
ctx.drawImage(el, sideWidth, 0, middleWidth, height, rx + 12, y + h / 2 - 17, rw - 24, 34);
ctx.drawImage(el, width - sideWidth, 0, sideWidth, height, rx + rw - 12, y + h / 2 - 17, 17, 34);
const maxSideWidth = Math.min(17, rw / 2 + 5);
ctx.drawImage(el, 0, 0, sideWidth, height, rx - 5, y + h / 2 - 17, maxSideWidth, 34);
if (rectInfo.width > 24)
ctx.drawImage(el, sideWidth, 0, middleWidth, height, rx + 12, y + h / 2 - 17, rw - 24, 34);
ctx.drawImage(
el,
width - sideWidth,
0,
sideWidth,
height,
rx + rw - (maxSideWidth - 5),
y + h / 2 - 17,
maxSideWidth,
34
);
ctx.imageSmoothingEnabled = true;
});
}
Expand Down

0 comments on commit ec41159

Please sign in to comment.