Skip to content
Snippets Groups Projects
Commit a1edc650 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Throw an exception when rendered line would exceed screen width

since we don't support line wrapping or truncation (yet).
parent 4be62114
No related branches found
No related tags found
No related merge requests found
...@@ -397,6 +397,10 @@ function output(str, font) { ...@@ -397,6 +397,10 @@ function output(str, font) {
padding = Math.floor(width - (linewidth + padding)); padding = Math.floor(width - (linewidth + padding));
} }
linewidth += padding;
if(linewidth > width)
throw new Error(format("Rendered line width (%u) > screen width (%u)", linewidth, width));
// Print each row of the font text // Print each row of the font text
for (var i = 0; i < maxheight; i++) { for (var i = 0; i < maxheight; i++) {
// Print padding spaces // Print padding spaces
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment