AndrewFromMelbourne / raspi2fb

Program to copy the Raspberry Pi display to a secondary framebuffer.
MIT License
94 stars 27 forks source link

fix rectangle coords check when src/dst have the same size #10

Closed hhromic closed 4 years ago

hhromic commented 4 years ago

Hi, first of all thanks for this software, it is really useful.

While setting up my Adafruit PiTFT 2.8" again after a long time of not using it I noticed that raspi2fb does not work anymore for me with the following error:

rectx must be between 0 and -1 for the configured framebuffers

I went to debug and realised that the recent "copyrect" functionality did not properly account for the case of same src/dst sizes, thus mistakenly giving the above error. This PR fixes the problem.

My config.txt file where I set the HDMI mode to 320x240 and the PiTFT which is also 320x240 is:

# PiTFT 2.8
dtoverlay=pitft28-resistive,speed=64000000,fps=30
disable_overscan=1
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt=320 240 60 1 0 0 0

I also fixed spurious blank spaces and lines in the codebase :)

AndrewFromMelbourne commented 4 years ago

Thanks for the fix ... looks good to me

hhromic commented 4 years ago

Happy to help! Thanks for merging!

Btw, raspi2fb has been working fine for me up to Raspbian Buster so maybe you want to update the README a bit so is not misleading that only works up to Jessie ;)