Closed choco closed 8 years ago
You're right. I forgot device pixel ratio...
Although I don't have retina display Mac, I think <neovim-editor>
shows very small fonts (right?). Default font size is 12px hence it shows 6px font because device pixel ratio is 2
.
I'll fix this.
@cHoco
If you can, screenshot is very helpful for me.
It isn't rendered smaller, just with a lower resolution. Here's a screenshot with neovim in terminal:
and neovim in NyaoVim:
As you can see NyaoVim looks a lot more pixelated
EDIT: As you can see I have another issue in rendering the status line and tabline, but I'll open another issue for that
Oh, I got it. It seems that <canvas>
requires twice size as its element size.
http://www.html5rocks.com/en/tutorials/canvas/hidpi/
Thanks!
Can confirm the above. I have an HiDPI screen on linux I would be more than happy to test bugfixes on.
I tried a bit but there are many fix points. It may take more time to fix this...
I reckon this is the only issue stopping me from trialling NyaoVim full time!
I started to use MacBook Pro Early 2015 today and got the same blocker :trollface:
I fixed this issue in HEAD as below.
At least in my environment (OS X 10.11.1, MacBook Pro Early 2015), it works well. Could anyone also check HEAD?
$ git clone https://github.com/rhysd/neovim-component.git
$ cd ./neovim-component
$ npm run dep
$ npm run example
After that, I'll check in NyaoVim and bump up version.
Here's what I get when follow the above script:
I get the same as @johnhamelink .
@johnhamelink @metalelf0
Ah, sorry, build
directory was not created automatically :confounded:
I fixed it in b5790f22ffc42c990bb468925621710c1fafa2d4.
@rhysd I still needed to run npm run build
before npm run example
worked, but it does now work and it looks great :+1:
Au, you're right, correct commands are below.
$ git clone https://github.com/rhysd/neovim-component.git
$ cd ./neovim-component
$ npm run dep
$ npm run build
$ npm run example
Thank you for confirming.
Works great here :D
@cHoco :+1:
I'll close this because I released NyaoVim 0.0.10 including this fix. Thank you, everyone!
Hello, on HiDPI displays, like Apple retina displays the canvas is rendered at low resolution. When creating the canvas you should take into account the the devicePixelRatio to determine height and width and then properly scale when drawing onto it.