cloudhead / rx

👾 Modern and minimalist pixel editor
https://discord.gg/xHggPjfsS9
GNU General Public License v3.0
3.09k stars 109 forks source link

Framebuffer size is incorrect on Linux with HiDPI display #52

Closed neauoire closed 4 years ago

neauoire commented 4 years ago

I've created a new issue so we could figure this one out on here. Could you remind me which line I should edit to better test the cursor positioning bug. I use a wacom intuos 3 tablet btw.

Issue

When I move over the canvas with the wacom pencil, there is an offset from the screen position, and the canvas position.

Screenshot from 2020-01-06 14-42-28@2x

cloudhead commented 4 years ago

Thanks for opening this! This bug is very likely due to the framebuffer being the incorrect size: the palette is also cut-off, and so is the session status bar. Effectively the framebuffer is exactly twice the resolution as the window, because rx is told that it should render 2 physical pixels for any given 1 "window" pixel.

If you make the following change:

- let hidpi_factor = win.hidpi_factor();
+ let hidpi_factor = 1.0;

You can force rx to create the right framebuffer size. If that works, at least we know the issue is dpi related, and we can go from there :+1:

neauoire commented 4 years ago

Screenshot from 2020-01-06 16-55-51@2x

Yeah, that totally fixes it!

cloudhead commented 4 years ago

Amaaaaaaaazing. I think I will introduce a CLI flag for now to turn off hidpi detection until I figure out why this is happening. It looks like hidpi detection is working, since you have a retina screen and it's detecting 2, but then the window being created is not big enough for the framebuffer :thinking:

If the interface is too small, you should be able scale it with :set scale = 2.0 - I'd be curious to know if that works correctly too with the current workaround.

neauoire commented 4 years ago

It does! And you know what, that's good enough for me :) We will be using Rx at Hundred Rabbits for our NES sprite assets, thank you.

Screenshot from 2020-01-06 18-03-15@2x

cloudhead commented 4 years ago

Awesome. Excited to see what you create, and feel free to provide feedback & ideas on the issues list!

I'll leave this issue open until I fix this properly.

:boat:

neauoire commented 4 years ago

I'll definitely be asking for .chr export, but we'll get to that later. Keep up the good work! Rx is a beauty.

cloudhead commented 4 years ago

This should be fixed now with #54 merged. If you could confirm, would be great. (the --features compatibility flag is no longer necessary)

cloudhead commented 4 years ago

Fixed.