Improve stride value

This commit is contained in:
Joshua Granick
2019-04-01 14:19:49 -07:00
parent 1d2abf7d2e
commit 303bb3c2a9

View File

@@ -65,7 +65,7 @@ class ImageBuffer
public var src(get, set):Dynamic;
/**
The stride, or number of data values per row in the image data
The stride, or number of data values (in bytes) per row in the image data
**/
public var stride(get, never):Int;
@@ -221,6 +221,6 @@ class ImageBuffer
@:noCompletion private function get_stride():Int
{
return width * 4;
return width * bitsPerPixel / 8;
}
}