mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-23 20:22:58 +03:00
Segment intersection value calculation has been fixed
This commit is contained in:
parent
476254e009
commit
c11e47b1cb
@ -6,15 +6,13 @@ namespace LimeReport {
|
|||||||
|
|
||||||
bool Segment::intersect(Segment value)
|
bool Segment::intersect(Segment value)
|
||||||
{
|
{
|
||||||
return ((value.m_end>=m_begin)&&(value.m_end<=m_end)) ||
|
return (value.m_begin <= m_end) && (value.m_end >= m_begin);
|
||||||
((value.m_begin>=m_begin)&&(value.m_end>=m_end)) ||
|
|
||||||
((value.m_begin>=m_begin)&&(value.m_end<=m_end)) ||
|
|
||||||
((value.m_begin<m_begin)&&(value.m_end>m_end)) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal Segment::intersectValue(Segment value)
|
qreal Segment::intersectValue(Segment value)
|
||||||
{
|
{
|
||||||
if ((value.m_end>=m_begin)&&(value.m_end<=m_end)){
|
if (!intersect(value)) return 0;
|
||||||
|
if ((value.m_end >= m_begin) && (value.m_end <= m_end)){
|
||||||
return value.m_end-m_begin;
|
return value.m_end-m_begin;
|
||||||
}
|
}
|
||||||
if ((value.m_begin>=m_begin)&&(value.m_end>=m_end)){
|
if ((value.m_begin>=m_begin)&&(value.m_end>=m_end)){
|
||||||
|
@ -804,7 +804,6 @@ void PageItemDesignIntf::initPageSize(const PageItemDesignIntf::PageSize &size)
|
|||||||
m_sizeChainging = true;
|
m_sizeChainging = true;
|
||||||
if (m_pageSize != Custom){
|
if (m_pageSize != Custom){
|
||||||
QSizeF pageSize = getRectByPageSize(size);
|
QSizeF pageSize = getRectByPageSize(size);
|
||||||
qDebug() << pageSize;
|
|
||||||
setWidth(pageSize.width());
|
setWidth(pageSize.width());
|
||||||
setHeight(pageSize.height());
|
setHeight(pageSize.height());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user