cleanup - store iconWidth and Heigth in variable

This commit is contained in:
krustur 2018-11-27 23:16:08 +01:00
parent 1790bf237a
commit 1c5062678b
1 changed files with 5 additions and 2 deletions

View File

@ -417,6 +417,9 @@ unsigned int AlignIcon(unsigned char *diskObjectName)
// Verbose(" toolType IM1 not found :'(\n", toolType);
// }
short iconWidth = diskObject->do_Gadget.Width;
short iconHeigth = diskObject->do_Gadget.Height;
// diskObject->do_CurrentX += 10;
if (diskObject->do_CurrentX == NO_ICON_POSITION && diskObject->do_CurrentX == NO_ICON_POSITION)
{
@ -432,7 +435,7 @@ unsigned int AlignIcon(unsigned char *diskObjectName)
{
if (CenterX)
{
newx = Align(origx, PaddingLeft, AlignX, diskObject->do_Gadget.Width / 2);
newx = Align(origx, PaddingLeft, AlignX, iconWidth / 2);
}
else
{
@ -453,7 +456,7 @@ unsigned int AlignIcon(unsigned char *diskObjectName)
{
if (BottomY)
{
newy = Align(origy, PaddingTop, AlignY, diskObject->do_Gadget.Height);
newy = Align(origy, PaddingTop, AlignY, iconHeight);
}
else
{