Created
October 25, 2018 08:12
-
-
Save ilmoeuro/4e4238958de5e352907823abdd9da465 to your computer and use it in GitHub Desktop.
Editorin fiksaus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/browser/src/Renderer/CanvasRenderer.ts b/browser/src/Renderer/CanvasRenderer.ts | |
index 3c95685e..1ddc0b5c 100644 | |
--- a/browser/src/Renderer/CanvasRenderer.ts | |
+++ b/browser/src/Renderer/CanvasRenderer.ts | |
@@ -296,25 +296,25 @@ export class CanvasRenderer implements INeovimRenderer { | |
const delta = boundsStartX - normalizedBoundsStartX | |
const normalizedBoundsWidth = Math.ceil(boundsWidth + delta) | |
- const normalizedBoundsY = Math.floor(boundsY) | |
- const deltaY = boundsY - normalizedBoundsY | |
- const normalizedHeight = Math.ceil(boundsY + deltaY) | |
+ const normalizedBoundsStartY = Math.floor(boundsY) | |
+ const deltaY = boundsY - normalizedBoundsStartY | |
+ const normalizedBoundsHeight = Math.ceil(fontHeightInPixels + deltaY) | |
this._canvasContext.fillStyle = backgroundColor || screenInfo.backgroundColor | |
if (this._isOpaque || (backgroundColor && backgroundColor !== screenInfo.backgroundColor)) { | |
this._canvasContext.fillRect( | |
normalizedBoundsStartX, | |
- normalizedHeight, | |
+ normalizedBoundsStartY, | |
normalizedBoundsWidth, | |
- fontHeightInPixels, | |
+ normalizedBoundsHeight, | |
) | |
} else { | |
this._canvasContext.clearRect( | |
normalizedBoundsStartX, | |
- normalizedHeight, | |
+ normalizedBoundsStartY, | |
normalizedBoundsWidth, | |
- fontHeightInPixels, | |
+ normalizedBoundsHeight, | |
) | |
} | |
@@ -329,8 +329,8 @@ export class CanvasRenderer implements INeovimRenderer { | |
} | |
this._canvasContext.fillText( | |
text, | |
- boundsStartX, | |
- normalizedBoundsY + linePaddingInPixels / 2, | |
+ normalizedBoundsStartX, | |
+ normalizedBoundsStartY + linePaddingInPixels / 2, | |
) | |
this._canvasContext.font = lastFontStyle | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment