rhysd / neovim-component

<neovim-editor> WebComponent to embed Neovim to your app with great ease
https://github.com/rhysd/NyaoVim
MIT License
193 stars 18 forks source link

Various rendering artifacts #12

Closed choco closed 8 years ago

choco commented 8 years ago

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 8 years ago

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.

romgrk commented 8 years ago

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 8 years ago

@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 8 years ago

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 8 years ago

Task list.

rhysd commented 8 years ago

I fixed resizing on v0.3.7.

tmp

choco commented 8 years ago

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 8 years ago

Thank you for confirming. Very helpful :smile:

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 :pensive:

choco commented 8 years ago

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 8 years ago

Thsnks!

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

2016-01-22 20 16 46

rhysd commented 8 years ago

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 8 years ago

Just checked and I think it is fixed indeed :dancer: Thank you again for your hard work! :smile:

rhysd commented 8 years ago

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