guiWindowCtrl Resizing Issue (fix included) - RESOLVED
by Richard Preziosi · in Torque 3D Professional · 03/05/2011 (8:22 am) · 2 replies
So there is a problem with guiWindowCtrl resizing. You'll notice when you resize the top and left edges that once the minimum size of the window is reached that it begins to move the window's physical position. This happens due to the fact that when you resize these two edges, you technically do need to move the positioning, however we need to change it's behavior when the min extent is reached.
To fix this issue change the following:
to:
Simple fix, may not be a bug to some, but definitely was a bug to me.
Edit: Bobbed when I shoulda weaved in the second code block, it is fixed now.
To fix this issue change the following:
if( ( !mMouseResizeHeight && !mMouseResizeWidth ) || !parent )
return;
mResizeWindow = true;
if( mResizeEdge & edgeBottom)
{
newExtent.y = getMin(parent->getHeight(), mOrigBounds.extent.y + deltaMousePosition.y);
resizeY = true;
}
else if ( mResizeEdge & edgeTop )
{
newPosition.y = mOrigBounds.point.y + deltaMousePosition.y;
newExtent.y = getMin(parent->getHeight(), mOrigBounds.extent.y - deltaMousePosition.y);
resizeY = true;
}
if( mResizeEdge & edgeRight )
{
newExtent.x = getMin(parent->getWidth(), mOrigBounds.extent.x + deltaMousePosition.x);
resizeX = true;
}
else if( mResizeEdge & edgeLeft )
{
newPosition.x = mOrigBounds.point.x + deltaMousePosition.x;
newExtent.x = getMin(parent->getWidth(), mOrigBounds.extent.x - deltaMousePosition.x);
resizeX = true;
}to:
if( ( !mMouseResizeHeight && !mMouseResizeWidth ) || !parent )
return;
mResizeWindow = true;
if( mResizeEdge & edgeBottom)
{
newExtent.y = getMin(parent->getHeight(), mOrigBounds.extent.y + deltaMousePosition.y);
resizeY = true;
}
else if ( mResizeEdge & edgeTop )
{
//newPosition.y = mOrigBounds.point.y + deltaMousePosition.y;
newExtent.y = getMin(parent->getHeight(), mOrigBounds.extent.y - deltaMousePosition.y);
// We only want to reposition until the minimum extent is reached -RP
if( newExtent.y >= mMinExtent.y){
newPosition.y = mOrigBounds.point.y + deltaMousePosition.y;
}
resizeY = true;
}
if( mResizeEdge & edgeRight )
{
newExtent.x = getMin(parent->getWidth(), mOrigBounds.extent.x + deltaMousePosition.x);
resizeX = true;
}
else if( mResizeEdge & edgeLeft )
{
//newPosition.x = mOrigBounds.point.x + deltaMousePosition.x;
newExtent.x = getMin(parent->getWidth(), mOrigBounds.extent.x - deltaMousePosition.x);
// We only want to reposition until the minimum extent is reached -RP
if( newExtent.x >= mMinExtent.x){
newPosition.x = mOrigBounds.point.x + deltaMousePosition.x;
}
resizeX = true;
}Simple fix, may not be a bug to some, but definitely was a bug to me.
Edit: Bobbed when I shoulda weaved in the second code block, it is fixed now.
Associate David Wyand
Gnometech Inc.
Logged as THREED-1466. Thanks!
- Dave