Skip to content

Commit 5c0d5d2

Browse files
committed
Snap the plot rect to integer coordinates.
1 parent 1066fc3 commit 5c0d5d2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/SwiftPlot/GraphLayout.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ public struct GraphLayout {
147147
// Sanitize the resulting rectangle.
148148
borderRect.size.width = max(borderRect.size.width, 0)
149149
borderRect.size.height = max(borderRect.size.height, 0)
150+
borderRect.origin.y.round(.up)
151+
borderRect.origin.x.round(.up)
152+
borderRect.size.width.round(.down)
153+
borderRect.size.height.round(.down)
150154
return borderRect
151155
}
152156

0 commit comments

Comments
 (0)