From 551fd8ee433cf3e3622e70114d39b3e0e123990d Mon Sep 17 00:00:00 2001 From: Fellippe Heitor Date: Sat, 13 May 2023 17:12:22 -0300 Subject: [PATCH] Advance row when printing on next column if width reached --- qb.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/qb.js b/qb.js index 7a69180..33f8957 100644 --- a/qb.js +++ b/qb.js @@ -2200,6 +2200,15 @@ var QB = new function() { else if (args[ai] == QB.COLUMN_ADVANCE) { // advance to the next column offset _locX += 14 - _locX % 13; + if (_locX > _textColumns()-1) { + _locX = 0; + if (_locY < _textRows()-1) { + _locY = _locY + 1; + } + else { + await _printScroll(); + } + } } else { var str = args[ai]; @@ -3572,4 +3581,4 @@ var QB = new function() { }; _init(); -} \ No newline at end of file +}