From 713ee5a2ac1a11df35e4a00623522e702500196a Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Tue, 28 Apr 2020 10:06:02 -0400 Subject: [PATCH] fix swapped xy in linear fill --- js/kiri-fill.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/js/kiri-fill.js b/js/kiri-fill.js index 3da9b2d8..6e1572dc 100644 --- a/js/kiri-fill.js +++ b/js/kiri-fill.js @@ -163,20 +163,20 @@ var gs_kiri_fill = exports; let density = target.density(); let offset = target.offset() / 2; let tile = 1 + (1 - density); - let tile_xc = span_x / tile; - let tile_yc = span_y / tile; + let tile_xc = Math.ceil(span_x / tile); + let tile_yc = Math.ceil(span_y / tile); if (target.zIndex() % 2 === 1) { for (let tx=0; tx<=tile_xc; tx++) { target.newline(); - target.emit(bounds.min.y, tx * tile + bounds.min.x); - target.emit(bounds.max.y, tx * tile + bounds.min.x); + target.emit(tx * tile + bounds.min.x, bounds.min.y); + target.emit(tx * tile + bounds.min.x, bounds.max.y); } } else { for (let ty=0; ty<=tile_yc; ty++) { target.newline(); - target.emit(ty * tile + bounds.min.y, bounds.min.x); - target.emit(ty * tile + bounds.min.y, bounds.max.x); + target.emit(bounds.min.x, ty * tile + bounds.min.y); + target.emit(bounds.max.x, ty * tile + bounds.min.y); } } }