go-rpi-rgb-led-matrix icon indicating copy to clipboard operation
go-rpi-rgb-led-matrix copied to clipboard

Re-allocating the led buffer makes matrix.At() method unusable

Open lukasmalkmus opened this issue 7 years ago • 0 comments

Hi @mcuadros. If a user of this package wants to get the image currently showing on the matrix (for example by using the draw package) he is not able to do so. The reason for this is located in this single line. After rendering, the led buffer is re-allocated and thus initialised with zero values. So after calling the Render() method on a matrix (or canvas), you only get 0 (color.Black). An easy fix is to just remove the mentioned line and keep the led buffer filled. Since users will usually just draw over with new content, this shouldn't be an issue.

Any hints or other ideas on this? I can also prepare a PR if you want to.

lukasmalkmus avatar Mar 01 '18 09:03 lukasmalkmus