Chris00 / ocaml-cairo

Binding to Cairo, a 2D Vector Graphics Library.
GNU Lesser General Public License v3.0
54 stars 8 forks source link

Image.get_stride does not behave as documented #3

Closed FlorentHoareau closed 9 years ago

FlorentHoareau commented 9 years ago

The generated documentation says :

val get_stride : Cairo.Surface.t -> int Get the stride of the image surface in bytes.

But in the implementation, the stride is divided by 4 if the image is RGB24 or ARGB32, which is incorrect (the value returned by the underlying Cairo function is indeed the correct stride in bytes). Shouldn't this behavior be reverted back to its original definition ? After all, the stride is used to compute the position of the beginning of a row ?

Chris00 commented 9 years ago

I reverted the change but I have documented what was its intended goal in order to help the user.