Various fixes

This commit is contained in:
Ilya Laktyushin
2023-01-11 01:59:22 +04:00
parent e08e7b2ecb
commit e1ff1cd98b
2 changed files with 18 additions and 8 deletions

View File

@@ -279,7 +279,7 @@ final class PenTool: DrawingElement {
let segmentsBounds = boundingRect(from: 0, to: self.segments.count).insetBy(dx: -20.0, dy: -20.0)
var combinedBounds = segmentsBounds
if self.hasArrow, let arrowLeftPath, let arrowRightPath {
combinedBounds = combinedBounds.union(arrowLeftPath.bounds).union(arrowRightPath.bounds).insetBy(dx: -20.0, dy: -20.0)
combinedBounds = combinedBounds.union(arrowLeftPath.bounds.insetBy(dx: -renderArrowLineWidth, dy: -renderArrowLineWidth)).union(arrowRightPath.bounds.insetBy(dx: -renderArrowLineWidth, dy: -renderArrowLineWidth)).insetBy(dx: -20.0, dy: -20.0)
}
return normalizeDrawingRect(combinedBounds, drawingSize: self.drawingSize)
}