rhysd/neovim-component

Various rendering artifacts

Closed this issue ยท 13 comments

choco commented

Hello, I've been testing NayoVim again after the HiDPI fix and I've been noticing a various number of artifacts in the rendering.

  1. The line heigh of text doesn't feel right, and sometimes it changes between characters
    screen shot 2016-01-08 at 12 45 24
  2. Characters are drawn even outside they cell
    screen shot 2016-01-08 at 12 46 22
  3. While scrolling parts little pieces of the text are left on the canvas in places where they where before
    screen shot 2016-01-08 at 12 46 32
  4. Spacing between character seems wrong
    screen shot 2016-01-08 at 12 46 15
  5. When resizing the window the rendering of the canvas just goes wild, part of the canvas turns white, other parts don't render etc...
    screen shot 2016-01-08 at 12 48 27
rhysd commented

Thank you for reporting them. I'll fix them one by one. I think most of them derives from an error on calculating cordinates to draw something.

In case it is of any use, as a reference: http://txtjs.com/

@rhysd were you still planning on not using any external lib for rendering?
And in any eventuality, were you planning on unhooking from the nvim GUI rendering at some point? I'm asking because I find it makes less and less sense to let neovim handle the syntax and coloration; it would make rendering much more easier.

rhysd commented

@romgrk

Thank you for the pointer to txtjs. It's interesting and I think I should check it out.

were you still planning on not using any external lib for rendering?

About pixi.js? Currently no plan because I thought it might improve performance. (but actually the bottle neck seemed to be rpc decoding) However, if txtjs is helpful, we might consider to use external library again.

And in any eventuality, were you planning on unhooking from the nvim GUI rendering at some point?

Hmm... I can't imagine what you say. Could you describe more detail? It may be good design to separate renderer as interface and enable to add external renderer, but I don't plan it yet because there are still many bugs to fix which have higher priority.

rhysd commented

I fixed the coodinate of text on rendering on v0.3.3. I forgot considering line-height on rendering text... <canvas>'s line-height is fixed to 1.2 and we must consider it on rendering.

Now,

  1. The line heigh of text doesn't feel right, and sometimes it changes between characters

I feel this was fixed as below.

2016-01-19 18 48 16

Because of the same reason,

  1. Characters are drawn even outside they cell

and

  1. Spacing between character seems wrong

may be fixed. If you can, please check them. In case 2., I don't know how to input the 'L N' font and in case 4., it is a patched font so I can't check it easily.

And I can't reproduce 3. yet.

rhysd commented

Task list.

  • The line heigh of text doesn't feel right, and sometimes it changes between characters
  • Characters are drawn even outside they cell
  • While scrolling parts little pieces of the text are left on the canvas in places where they where before
  • Spacing between character seems wrong (I can't repro yet)
  • When resizing the window the rendering of the canvas just goes wild, part of the canvas turns white, other parts don't render etc...
rhysd commented

I fixed resizing on v0.3.7.

tmp

choco commented

Hey, sorry for not getting back to you sooner! Just pulled the new changes and tested around. Line height between characters seems to be fixed, but when scrolling the rendering still gets messed up :( and text isn't aligned anymore. But I think the problem must be somewhere else.
Character still render outside of their cell, to reproduce it easily install the vim-airline plugin open a textfiles and just scroll around, the line number on the statusbar should render outside its cell as shown in my first screenshot.

Resizing seems to be fixed, but it still has some problems, for example if I keep resizing instead of just maximizing or minimizing the window the window still ends up white.

When I finish my exams next month I plan on helping out in fixing these issue because I think this project is really important for the vim future :D
For reference there's another project implementing neovim in Electron here https://github.com/coolwanglu/neovim-e and after trying it out I can confirm that it has none of the issues I mentioned in this post, so we may take a look at how it perform rendering and resizing and figure out what we've been missing!

rhysd commented

Thank you for confirming. Very helpful ๐Ÿ˜„

Hmm... Some problems don't occur in my environment and do occur in yours. 'outside the cell' problem occurs, but both scrolling and maximizing are OK in my environment. I guess they're problem related to font. Could you tell me what font you're using?

For reference there's another project implementing neovim in Electron here
https://github.com/coolwanglu/neovim-e and after trying it out I can confirm that it has none of the issues

It must be also helpful! Thank you in advance.

When I finish my exams next month I plan on helping out in fixing these issue

It's so helpful! I have full-time job and I can only write code for my project at night after work ๐Ÿ˜”

choco commented

Hmm... Some problems don't occur in my environment and do occur in yours. 'outside the cell' problem > occurs, but both scrolling and maximizing are OK in my environment. I guess they're problem related to > font. Could you tell me what font you're using?

It's a tweaked version of Source Code Pro, I got it in my dotfiles repository: https://github.com/cHoco/dotFiles/blob/master/coding-fonts/source-code-pro/Source%20Code%20Pro%20plus%20Devicons.otf

It's so helpful! I have full-time job and I can only write code for my project at night after work

Your work is really appreciated, thank you for this great project :D

rhysd commented

Thsnks!

And I seemed to be able to reproduce the scroll issue.

2016-01-22 20 16 46

rhysd commented

I fixed rendering problems on truncating height of region at v0.4.0.

Characters are drawn even outside they cell

and

While scrolling parts little pieces of the text are left on the canvas in places where they where before

seem to be fixed in my environment (MacBook Pro Retina 2015). Could you check this fix?

choco commented

Just checked and I think it is fixed indeed ๐Ÿ’ƒ
Thank you again for your hard work! ๐Ÿ˜„

rhysd commented

Thank you very much for confirming.
I'll update NyaoVim's dependency today!