Closed bugadani closed 4 years ago
Yeah that definitely looks like it should be height - 1
. There's a similar block of code here, so it might be worth moving the min/max reset into a private method.
I haven't given it much thought, but shouldn't these be rotation aware values? Is min_y the same when rotated by 90 or 270 degrees?
Yes, there're the other variables which take the rotation into account. However it's a bit weird to have the manual comparison in the code. There're max()
and min()
functions for that.
There's a similar block of code here, so it might be worth moving the min/max reset into a private method.
You mislead me :) That block is marking the whole display to be updated, the original block resets the area to nothing.
Oop yes you're right, min/max are swapped there. My bad!
Based on this metric I believe the linked line may be incorrect.
https://github.com/jamwaffles/ssd1306/blob/96170fd21419e73fdb2299f395b07836d52d090f/src/mode/graphics.rs#L161
If that's supposed to be height, I'm happy to fix it, otherwise please provide an explanation why it's width.