dmurdoch / rgl

rgl is a 3D visualization system based on OpenGL. It provides a medium to high level interface for use in R, currently modelled on classic R graphics, with extensions to allow for interaction.
https://dmurdoch.github.io/rgl/
GNU General Public License v2.0
84 stars 20 forks source link

Fix for: Error in Colors[i, ] : subscript out of bounds when setting withColors = FALSE with endian formats #428

Closed aidanmorales closed 2 weeks ago

aidanmorales commented 2 weeks ago

Issue #425

Only relevant changes are now shown.

dmurdoch commented 2 weeks ago

Thanks for simplifying the patch. I've committed a different fix instead, because now I understand the issue. The problem was that even with withColors = FALSE, the Colors matrix had rows added. That's fixed, and the test is now simplified to use !withColors. The endian = endian argument isn't needed when writing Colors because those values are just 1 byte, so both versions of endian write the same thing.

I also did some minimal formatting changes. I don't like doing those to otherwise unmodified lines because they obscure the git blame history of the code.