gui shadowvar cleanups

This commit is contained in:
Azaezel 2018-03-15 14:50:54 -05:00
parent 2009bf1ee3
commit 342bf8f3d3
9 changed files with 40 additions and 46 deletions

View file

@ -542,10 +542,10 @@ void GuiEditCtrl::onMouseDragged( const GuiEvent &event )
// Snap the mouse cursor to grid if active. Do this on the mouse cursor so that we handle
// incremental drags correctly.
Point2I mousePoint = event.mousePoint;
snapToGrid( mousePoint );
Point2I dragPoint = event.mousePoint;
snapToGrid(dragPoint);
Point2I delta = mousePoint - mLastDragPos;
Point2I delta = dragPoint - mLastDragPos;
// If CTRL is down, apply smart snapping.
@ -584,7 +584,7 @@ void GuiEditCtrl::onMouseDragged( const GuiEvent &event )
// Remember drag point.
mLastDragPos = mousePoint;
mLastDragPos = dragPoint;
}
else if (mMouseDownMode == MovingSelection && mSelectedControls.size())
{
@ -770,7 +770,7 @@ void GuiEditCtrl::onRender(Point2I offset, const RectI &updateRect)
( mMouseDownMode == MovingSelection || mMouseDownMode == SizingSelection ) &&
( mGridSnap.x || mGridSnap.y ) )
{
Point2I cext = getContentControl()->getExtent();
cext = getContentControl()->getExtent();
Point2I coff = getContentControl()->localToGlobalCoord(Point2I(0,0));
// create point-dots
@ -847,8 +847,8 @@ void GuiEditCtrl::onRender(Point2I offset, const RectI &updateRect)
if( mSnapTargets[ axis ] )
{
RectI bounds = mSnapTargets[ axis ]->getGlobalBounds();
drawer->drawRect( bounds, ColorI( 128, 128, 128, 128 ) );
RectI snapBounds = mSnapTargets[ axis ]->getGlobalBounds();
drawer->drawRect(snapBounds, ColorI( 128, 128, 128, 128 ) );
}
}
}

View file

@ -177,9 +177,9 @@ void GuiFilterCtrl::onRender(Point2I offset, const RectI &updateRect)
Point2I pos = offset;
Point2I ext = getExtent();
RectI r(pos, ext);
GFX->getDrawUtil()->drawRectFill(r, ColorI(255,255,255));
GFX->getDrawUtil()->drawRect(r, ColorI(0,0,0));
RectI bgRect(pos, ext);
GFX->getDrawUtil()->drawRectFill(bgRect, ColorI(255,255,255));
GFX->getDrawUtil()->drawRect(bgRect, ColorI(0,0,0));
// shrink by 2 pixels
pos.x += 2;
@ -218,13 +218,13 @@ void GuiFilterCtrl::onRender(Point2I offset, const RectI &updateRect)
// draw the knots
for (U32 k=0; k < mFilter.size(); k++)
{
RectI r;
r.point.x = (S32)(((F32)ext.x/(F32)(mFilter.size()-1)*(F32)k));
r.point.y = (S32)(ext.y - ((F32)ext.y * mFilter[k]));
r.point += pos + Point2I(-2,-2);
r.extent = Point2I(5,5);
RectI knotRect;
knotRect.point.x = (S32)(((F32)ext.x/(F32)(mFilter.size()-1)*(F32)k));
knotRect.point.y = (S32)(ext.y - ((F32)ext.y * mFilter[k]));
knotRect.point += pos + Point2I(-2,-2);
knotRect.extent = Point2I(5,5);
GFX->getDrawUtil()->drawRectFill(r, ColorI(255,0,0));
GFX->getDrawUtil()->drawRectFill(knotRect, ColorI(255,0,0));
}
renderChildControls(offset, updateRect);

View file

@ -658,18 +658,18 @@ void GuiInspector::refresh()
if( !group && !isGroupFiltered( itr->pGroupname ) )
{
GuiInspectorGroup *group = new GuiInspectorGroup( itr->pGroupname, this );
GuiInspectorGroup *newGroup = new GuiInspectorGroup( itr->pGroupname, this );
group->registerObject();
if( !group->getNumFields() )
newGroup->registerObject();
if( !newGroup->getNumFields() )
{
#ifdef DEBUG_SPEW
Platform::outputDebugString( "[GuiInspector] Removing empty group '%s'",
group->getCaption().c_str() );
newGroup->getCaption().c_str() );
#endif
// The group ended up having no fields. Remove it.
group->deleteObject();
newGroup->deleteObject();
}
else
{

View file

@ -1035,7 +1035,6 @@ GuiControl* GuiInspectorTypeEaseF::constructEditControl()
mBrowseButton = new GuiButtonCtrl();
{
RectI browseRect( Point2I( ( getLeft() + getWidth()) - 26, getTop() + 2), Point2I(20, getHeight() - 4) );
char szBuffer[512];
dSprintf( szBuffer, sizeof( szBuffer ), "GetEaseF(%d.getText(), \"%d.apply\", %d.getRoot());", retCtrl->getId(), getId(), getId() );
mBrowseButton->setField( "Command", szBuffer );
mBrowseButton->setField( "text", "E" );