Skip to content

Commit 46a38b0

Browse files
committed
Always use more sophisticated element for TPad shadow
Let use transparent colors with TPave filling
1 parent e38021a commit 46a38b0

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

modules/hist/TPavePainter.mjs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -262,17 +262,18 @@ class TPavePainter extends ObjectPainter {
262262
if ((brd > 1) && (pt.fShadowColor > 0) && !pt.fNpaves && (dx || dy) && !noborder) {
263263
const scol = this.getColor(pt.fShadowColor);
264264
let spath = '';
265-
if (this.fillatt.empty()) {
266-
if ((dx < 0) && (dy < 0))
267-
spath = `M0,0v${height-brd}h${-brd}v${-height}h${width}v${brd}`;
268-
else // ((dx < 0) && (dy > 0))
269-
spath = `M0,${height}v${brd-height}h${-brd}v${height}h${width}v${-brd}`;
270-
} else {
271-
// when main is filled, one also can use fill for shadow to avoid complexity
272-
spath = `M${dx*brd},${dy*brd}v${height}h${width}v${-height}`;
273-
}
265+
266+
if ((dx < 0) && (dy < 0))
267+
spath = `M0,0v${height-brd}h${-brd}v${-height}h${width}v${brd}z`;
268+
else if ((dx < 0) && (dy > 0))
269+
spath = `M0,${height}v${brd-height}h${-brd}v${height}h${width}v${-brd}z`;
270+
else if ((dx > 0) && (dy < 0))
271+
spath = `M${brd},0v${-brd}h${width}v${height}h${-brd}v${brd-height}z`;
272+
else
273+
spath = `M${width},${brd}h${brd}v${height}h${-width}v${-brd}h${width-brd}z`;
274+
274275
this.draw_g.append('svg:path')
275-
.attr('d', spath + 'z')
276+
.attr('d', spath)
276277
.style('fill', scol)
277278
.style('stroke', scol)
278279
.style('stroke-width', '1px');

0 commit comments

Comments
 (0)