Пример #1
0
float ATOM_CurveEditor::coordToKeyValue (int coord) const
{
	int coordInCanvas = coord + getScrollValue().y;
	unsigned canvasSize = (getClientRect().size.h > getCanvasSize().h) ? getClientRect().size.h : getCanvasSize().h;
	float origin = canvasSize * _originValueAxis;
	return (origin - coordInCanvas) / _valueAxisUnitResolution;
}
Пример #2
0
float ATOM_CurveEditor::coordToTimeInSecond (int coord) const
{
	int coordInCanvas = coord + getScrollValue().x;
	unsigned canvasSize = (getClientRect().size.w > getCanvasSize().w) ? getClientRect().size.w : getCanvasSize().w;
	float origin = canvasSize * _originTimeAxis;
	return (coordInCanvas - origin) / _timeAxisUnitResolution;
}
Пример #3
0
//-----------------------------------------------------------------------------
void CScrollContainer::onDragMove (IDataPackage* drag, const CPoint& where)
{
	if (autoDragScroll)
	{
		float x, y;
		if (getScrollValue (where, x, y))
		{
			CScrollView* scrollView = static_cast<CScrollView*> (getParentView ());
			if (scrollView)
			{
				CRect r (getViewSize ());
				r.offset (x, y);
				scrollView->makeRectVisible (r);
			}
		}
	}
	return CViewContainer::onDragMove (drag, where);
}
Пример #4
0
int ATOM_CurveEditor::timeValueToCoord (float timeInSecond) const
{
	unsigned canvasSize = (getClientRect().size.w > getCanvasSize().w) ? getClientRect().size.w : getCanvasSize().w;
	return timeInSecond * _timeAxisUnitResolution + canvasSize * _originTimeAxis - getScrollValue().x;
}
Пример #5
0
int ATOM_CurveEditor::keyValueToCoord (float value) const
{
	unsigned canvasSize = (getClientRect().size.h > getCanvasSize().h) ? getClientRect().size.h : getCanvasSize().h;
	return canvasSize * _originValueAxis - value * _valueAxisUnitResolution - getScrollValue().y;
}