| 438 | } |
| 439 | |
| 440 | function createMatrixLine(shape: Omit<LineShape, 'percent'>, style: LineStyleProps, z2: number): Line { |
| 441 | const lineWidth = style.lineWidth; |
| 442 | if (lineWidth) { |
| 443 | if (round(shape.x1 * 2) === round(shape.x2 * 2)) { |
| 444 | shape.x1 = shape.x2 = subPixelOptimize(shape.x1, lineWidth, true); |
| 445 | } |
| 446 | if (round(shape.y1 * 2) === round(shape.y2 * 2)) { |
| 447 | shape.y1 = shape.y2 = subPixelOptimize(shape.y1, lineWidth, true); |
| 448 | } |
| 449 | } |
| 450 | return new Line({ |
| 451 | shape, |
| 452 | style, |
| 453 | silent: true, |
| 454 | z2, |
| 455 | }); |
| 456 | } |
| 457 | |
| 458 | export default MatrixView; |