Fixed packing images with only one color

fonts_experiment 1.0.0.0
Valeriy Mironov 2017-11-26 10:33:27 +02:00
parent 4b69ea94dc
commit 78c009f7e3
1 changed files with 2 additions and 2 deletions

View File

@ -40,8 +40,8 @@ namespace Resources
_paletteColors = (ushort) _palette.Count;
_bitsPerPixel = (ushort) Math.Ceiling(Math.Log(_paletteColors, 2));
if (_bitsPerPixel == 3)
_bitsPerPixel = 4;
if (_bitsPerPixel == 3) _bitsPerPixel = 4;
if (_bitsPerPixel == 0) _bitsPerPixel = 1;
if (_bitsPerPixel != 1 && _bitsPerPixel != 2 && _bitsPerPixel != 4)
throw new ArgumentException($"{0} bits per pixel doesn't supported.");