diff --git a/src/pixie/fonts.nim b/src/pixie/fonts.nim index f84a5fa..423cbf8 100644 --- a/src/pixie/fonts.nim +++ b/src/pixie/fonts.nim @@ -235,12 +235,12 @@ proc typeset*( of haLeft: discard of haCenter: - xAdjustment = round((bounds.x - furthestX) / 2) + xAdjustment = (bounds.x - furthestX) / 2 of haRight: xAdjustment = bounds.x - furthestX if xAdjustment != 0: - for i in 0 ..< result.positions.len: + for i in start .. stop: result.positions[i].x += xAdjustment result.selectionRects[i].x += xAdjustment diff --git a/tests/fonts/diffs/alignments.png b/tests/fonts/diffs/alignments.png index fe4a184..016cd6e 100644 Binary files a/tests/fonts/diffs/alignments.png and b/tests/fonts/diffs/alignments.png differ diff --git a/tests/fonts/rendered/alignments.png b/tests/fonts/rendered/alignments.png index 0c4f480..fda3688 100644 Binary files a/tests/fonts/rendered/alignments.png and b/tests/fonts/rendered/alignments.png differ