(ctx, opts, item)
| 229 | } |
| 230 | |
| 231 | function drawPointLabelBox(ctx, opts, item) { |
| 232 | const {left, top, right, bottom} = item; |
| 233 | const {backdropColor} = opts; |
| 234 | |
| 235 | if (!isNullOrUndef(backdropColor)) { |
| 236 | const borderRadius = toTRBLCorners(opts.borderRadius); |
| 237 | const padding = toPadding(opts.backdropPadding); |
| 238 | ctx.fillStyle = backdropColor; |
| 239 | |
| 240 | const backdropLeft = left - padding.left; |
| 241 | const backdropTop = top - padding.top; |
| 242 | const backdropWidth = right - left + padding.width; |
| 243 | const backdropHeight = bottom - top + padding.height; |
| 244 | |
| 245 | if (Object.values(borderRadius).some(v => v !== 0)) { |
| 246 | ctx.beginPath(); |
| 247 | addRoundedRectPath(ctx, { |
| 248 | x: backdropLeft, |
| 249 | y: backdropTop, |
| 250 | w: backdropWidth, |
| 251 | h: backdropHeight, |
| 252 | radius: borderRadius, |
| 253 | }); |
| 254 | ctx.fill(); |
| 255 | } else { |
| 256 | ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight); |
| 257 | } |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | function drawPointLabels(scale, labelCount) { |
| 262 | const {ctx, options: {pointLabels}} = scale; |
no test coverage detected