##// END OF EJS Templates
Revert "Fixes line uder grid issue"...
Revert "Fixes line uder grid issue" This reverts commit 3ea3ba4a33950ea7420e16913d228ed53fe566c3.

File last commit:

r139:167329998526
r191:0b54368f72bb
Show More
domain.cpp
45 lines | 767 B | text/x-c | CppLexer
#include "domain_p.h"
QTCOMMERCIALCHART_BEGIN_NAMESPACE
Domain::Domain():
m_minX(0),
m_maxX(0),
m_minY(0),
m_maxY(0)
{
}
Domain::~Domain()
{
// TODO Auto-generated destructor stub
}
qreal Domain::spanX() const
{
Q_ASSERT(m_maxX >= m_minX);
return m_maxX - m_minX;
}
qreal Domain::spanY() const
{
Q_ASSERT(m_maxY >= m_minY);
return m_maxY - m_minY;
}
Domain Domain::subDomain(const QRectF& rect, qreal maxWidth,qreal maxHeight) const
{
Domain domain;
qreal dx = spanX() / maxWidth;
qreal dy = spanY() / maxHeight;
domain.m_minX = m_minX + dx * rect.left();
domain.m_maxX = m_minX + dx * rect.right();
domain.m_minY = m_maxY - dy * rect.bottom();
domain.m_maxY = m_maxY - dy * rect.top();
return domain;
}
QTCOMMERCIALCHART_END_NAMESPACE