Canvas rendered at low-res on HiDPI displays
Closed this issue ยท 17 comments
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.
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.
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
I fixed this issue in HEAD as below.
- before
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.
I get the same as @johnhamelink .
Ah, sorry, build
directory was not created automatically ๐
I fixed it in b5790f2.
@rhysd I still needed to run npm run build
before npm run example
worked, but it does now work and it looks great ๐
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
I'll close this because I released NyaoVim 0.0.10 including this fix.
Thank you, everyone!