Fix FontTextureAtlas::GetSlotData not including padding correctly
This commit is contained in:
@@ -151,10 +151,12 @@ void FontTextureAtlas::CopyDataIntoSlot(const FontTextureAtlasSlot* slot, const
|
|||||||
byte* FontTextureAtlas::GetSlotData(const FontTextureAtlasSlot* slot, uint32& width, uint32& height, uint32& stride)
|
byte* FontTextureAtlas::GetSlotData(const FontTextureAtlasSlot* slot, uint32& width, uint32& height, uint32& stride)
|
||||||
{
|
{
|
||||||
const uint32 padding = GetPaddingAmount();
|
const uint32 padding = GetPaddingAmount();
|
||||||
|
uint32 x = slot->X + padding;
|
||||||
|
uint32 y = slot->Y + padding;
|
||||||
width = slot->Width - padding * 2;
|
width = slot->Width - padding * 2;
|
||||||
height = slot->Height - padding * 2;
|
height = slot->Height - padding * 2;
|
||||||
stride = _width * _bytesPerPixel;
|
stride = _width * _bytesPerPixel;
|
||||||
return &_data[slot->Y * _width * _bytesPerPixel + slot->X * _bytesPerPixel];
|
return &_data[y * _width * _bytesPerPixel + x * _bytesPerPixel];
|
||||||
}
|
}
|
||||||
|
|
||||||
void FontTextureAtlas::copyRow(const RowData& copyRowData) const
|
void FontTextureAtlas::copyRow(const RowData& copyRowData) const
|
||||||
|
|||||||
Reference in New Issue
Block a user