Пример #1
0
//---------------------------------------
void Widget::Draw( const Camera& camera )
{
	// If not visible, do not draw this Widget or its children.
	if( mIsVisible )
	{
		// Draw the Widget.
		OnDraw( camera );

		if( mDebugLayout )
		{
			// Draw debug visual.
			RectF bounds = CalculateBounds();
			DrawRectOutline( bounds.Left, bounds.Top, bounds.Width(), bounds.Height(), Color::PINK, 1.5f );
		}
	}
}
Пример #2
0
	void FrameScrollView::UpdateCameraLimits(float dt)
	{
		if (o2Input.IsCursorDown())
			return;

		RectF camRect = mViewCamera.GetRect();
		Vec2F camSize = camRect.Size();

		mHorScrollbar->SetValueRange(Math::Min(mAvailableArea.left + camSize.x*0.5f, camRect.Center().x), 
									 Math::Max(mAvailableArea.right - camSize.x*0.5f, camRect.Center().x));
		mHorScrollbar->SetScrollHandleSize(camRect.Width());

		mVerScrollbar->SetValueRange(Math::Min(mAvailableArea.bottom + camSize.y*0.5f, camRect.Center().y),
									 Math::Max(mAvailableArea.top - camSize.y*0.5f, camRect.Center().y));

		mVerScrollbar->SetScrollHandleSize(camRect.Height());
	}