Revises loops on arrays

This commit is contained in:
Phil Mercurio
2020-02-28 17:21:36 -08:00
parent b550042709
commit 6e4525c7a5
6 changed files with 10033 additions and 4067 deletions

View File

@@ -673,7 +673,7 @@
if (typeof this.str == "string") {
var lines = this.str.split("\\n");
for (var i in lines) {
for (var i=0; i < lines.length; i++) {
ctx.fillText(
lines[i],
this.properties["align"] == "left" ? 15 : this.size[0] - 15,
@@ -704,7 +704,7 @@
this.last_ctx.font =
this.properties["fontsize"] + "px " + this.properties["font"];
var max = 0;
for (var i in lines) {
for (var i=0; i < lines.length; i++) {
var w = this.last_ctx.measureText(lines[i]).width;
if (max < w) {
max = w;