Fix arrows not drawing when dragged left or upward
CGRect.maxX/maxY standardize to positive values, collapsing the arrow endpoint onto the start point for negative width/height. Use origin + size instead to preserve direction. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -108,7 +108,8 @@ final class AnnotationCanvasView: NSView {
|
||||
let handleRect: CGRect
|
||||
if item.kind == .arrow {
|
||||
let start = item.rect.origin
|
||||
let end = CGPoint(x: item.rect.maxX, y: item.rect.maxY)
|
||||
let end = CGPoint(x: item.rect.origin.x + item.rect.size.width,
|
||||
y: item.rect.origin.y + item.rect.size.height)
|
||||
handleRect = CGRect(x: min(start.x, end.x), y: min(start.y, end.y),
|
||||
width: abs(end.x - start.x), height: abs(end.y - start.y))
|
||||
} else if item.kind == .text {
|
||||
|
||||
Reference in New Issue
Block a user