Stop using weird transforms for double-width

pull/2/head
cpsdqs 7 years ago
parent 915113a628
commit 681685fa3b
Signed by untrusted user: cpsdqs
GPG Key ID: 3F59586BB7448DD1
  1. 5
      js/term/screen_renderer.js

@ -290,7 +290,7 @@ module.exports = class CanvasRenderer extends EventEmitter {
if (dblWidth) cellWidth *= 2 if (dblWidth) cellWidth *= 2
ctx.save() ctx.save()
ctx.translate(screenX + 0.5 * cellWidth, screenY + 0.5 * cellHeight) ctx.translate(padding, screenY + 0.5 * cellHeight)
if (dblWidth) ctx.scale(2, 1) if (dblWidth) ctx.scale(2, 1)
if (dblHeightTop) { if (dblHeightTop) {
// top half // top half
@ -301,7 +301,8 @@ module.exports = class CanvasRenderer extends EventEmitter {
ctx.scale(1, 2) ctx.scale(1, 2)
ctx.translate(0, -cellHeight / 4) ctx.translate(0, -cellHeight / 4)
} }
ctx.translate((-screenX - (dblWidth ? 1.5 : 0.5) * cellWidth) / (dblWidth ? 2 : 1), -screenY - 0.5 * cellHeight) ctx.translate(-padding, -screenY - 0.5 * cellHeight)
if (dblWidth) ctx.translate(-cellWidth / 4, 0)
if (dblHeightBot || dblHeightTop) { if (dblHeightBot || dblHeightTop) {
// characters overflow -- needs clipping // characters overflow -- needs clipping

Loading…
Cancel
Save