mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 11:48:02 -04:00
Fixed derp in gpu.set introduced with wide char checks (aka 'index out of bounds of doom').
This commit is contained in:
parent
3916a6a6ae
commit
5683d61435
@ -128,7 +128,7 @@ class TextBuffer(var width: Int, var height: Int, initialFormat: PackedColor.Col
|
|||||||
val c = s(x - col)
|
val c = s(x - col)
|
||||||
changed = changed || (line(bx) != c) || (lineColor(bx) != packed)
|
changed = changed || (line(bx) != c) || (lineColor(bx) != packed)
|
||||||
setChar(line, lineColor, bx, c)
|
setChar(line, lineColor, bx, c)
|
||||||
bx += FontUtil.wcwidth(c)
|
bx += math.max(1, FontUtil.wcwidth(c))
|
||||||
}
|
}
|
||||||
changed
|
changed
|
||||||
}
|
}
|
||||||
@ -147,7 +147,7 @@ class TextBuffer(var width: Int, var height: Int, initialFormat: PackedColor.Col
|
|||||||
for (x <- bx until math.min(col + w, width) if bx < line.length) {
|
for (x <- bx until math.min(col + w, width) if bx < line.length) {
|
||||||
changed = changed || (line(bx) != c) || (lineColor(bx) != packed)
|
changed = changed || (line(bx) != c) || (lineColor(bx) != packed)
|
||||||
setChar(line, lineColor, bx, c)
|
setChar(line, lineColor, bx, c)
|
||||||
bx += FontUtil.wcwidth(c)
|
bx += math.max(1, FontUtil.wcwidth(c))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
changed
|
changed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user