In some areas, you use %this.currDir, elsewhere, you use %currDir. Where you use %currDirm, you are using a single = rather than a ==, so it is setting %currDir to 1 rather checking if the direction is already the y axis.
Try this (almost completely rewritten) version:
function GuiWindowCtrl::extentSlide(%this, %ext, %rate, %tick)
{
cancel(%this.extentSlide);
if(%this.extent $= %ext || %rate == 0)
return;
if(getWord(%ext, 0) != getWord(%this.extent, 0))
{
%dif = getWord(%ext, 0) - getWord(%this.extent, 0);
if(mAbs(%dif) < %rate)
%this.extent = getWord(%ext, 0) SPC getWord(%this.extent, 0);
else if(%dif > 0)
%this.extent = vectorAdd(%this.extent, %rate SPC 0);
else
%this.extent = vectorAdd(%this.extent, -%rate SPC 0);
}
else if(getWord(%ext, 1) != getWord(%this.extent, 1))
{
%dif = getWord(%ext, 1) - getWord(%this.extent, 1);
if(mAbs(%dif) < %rate)
%this.extent = %ext;
else if(%dif > 0)
%this.extent = vectorAdd(%this.extent, 0 SPC %rate);
else
%this.extent = vectorAdd(%this.extent, 0 SPC -%rate);
}
else
return;
%this.resize(getWord(%this.position, 0), getWord(%this.position, 1), getWord(%this.extent, 0), getWord(%this.extent, 1));
%this.extentSlide = %this.schedule(%tick, extentSlide, %ext, %rate, %tick);
}
Using %this.resize() is required for the window controls and probably any contained GUI components to properly update.