Fixed bug into GLTexture::load_from_svg_files_as_sprites_array() - One pixel of generated icons was cut away

This commit is contained in:
enricoturri1966 2022-02-04 12:02:10 +01:00
parent 30dc2bf39c
commit b04e05b3f7

View File

@ -211,7 +211,7 @@ bool GLTexture::load_from_svg_files_as_sprites_array(const std::vector<std::stri
float scale = (float)sprite_size_px / std::max(image->width, image->height);
// offset by 1 to leave the first pixel empty (both in x and y)
nsvgRasterize(rast, image, 1, 1, scale, sprite_data.data(), sprite_size_px, sprite_size_px, sprite_stride);
nsvgRasterize(rast, image, 1, 1, scale, sprite_data.data(), sprite_size_px_ex, sprite_size_px_ex, sprite_stride);
// makes white only copy of the sprite
::memcpy((void*)sprite_white_only_data.data(), (const void*)sprite_data.data(), sprite_bytes);