(
shape: RectShape, style: ItemStyleProps, z2: number
)
| 417 | // `dataToLayout` is not consistent with this rendering, and the caller (like heatmap) can |
| 418 | // not precisely align with the matrix border. |
| 419 | function createMatrixRect( |
| 420 | shape: RectShape, style: ItemStyleProps, z2: number |
| 421 | ): Rect { |
| 422 | // Currently `subPixelOptimizeRect` can not be used here because it will break rect alignment. |
| 423 | // Optimize line and rect with the same direction. |
| 424 | const lineWidth = style.lineWidth; |
| 425 | if (lineWidth) { |
| 426 | const x2Original = shape.x + shape.width; |
| 427 | const y2Original = shape.y + shape.height; |
| 428 | shape.x = subPixelOptimize(shape.x, lineWidth, true); |
| 429 | shape.y = subPixelOptimize(shape.y, lineWidth, true); |
| 430 | shape.width = subPixelOptimize(x2Original, lineWidth, true) - shape.x; |
| 431 | shape.height = subPixelOptimize(y2Original, lineWidth, true) - shape.y; |
| 432 | } |
| 433 | return new Rect({ |
| 434 | shape, |
| 435 | style: style, |
| 436 | z2, |
| 437 | }); |
| 438 | } |
| 439 | |
| 440 | function createMatrixLine(shape: Omit<LineShape, 'percent'>, style: LineStyleProps, z2: number): Line { |
| 441 | const lineWidth = style.lineWidth; |
no outgoing calls
no test coverage detected
searching dependent graphs…