Skip to content
Snippets Groups Projects
Commit 33478ae3 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

new fct Data2DItem::isZoomed instead of MaskEditorCanvas::isAxisRangeMatchData

parent 351942b4
No related branches found
No related tags found
1 merge request!1995update data frame in plot comparison
......@@ -130,6 +130,11 @@ void Data2DItem::copyZRangeFromItem(DataItem* sourceItem)
setZrange(source->lowerZ(), source->upperZ());
}
bool Data2DItem::isZoomed() const
{
return lowerX() > xMin() || upperX() < xMax() || lowerY() > yMin() || upperY() < yMax();
}
QCPColorGradient Data2DItem::currentGradientQCP() const
{
if (gradient_map.contains(currentGradient()))
......
......@@ -48,6 +48,7 @@ public:
double upperZ() const;
void setZrange(double zmin, double zmax);
void copyZRangeFromItem(DataItem* sourceItem);
bool isZoomed() const;
//! Color scheme of the color map
QCPColorGradient currentGradientQCP() const;
......
......@@ -101,30 +101,13 @@ void MaskEditorCanvas::onResetViewRequest()
{
m_view->onResetViewRequest();
if (isAxisRangeMatchData())
setZoomToROI();
else
if (m_data2DItem->isZoomed())
m_data2DItem->resetView();
else
setZoomToROI();
gProjectDocument.value()->setModified();
}
//! Returns true if IntensityData is currently at 100% zoom level
bool MaskEditorCanvas::isAxisRangeMatchData() const
{
ASSERT(m_data2DItem);
if (m_data2DItem->lowerX() != m_data2DItem->xMin())
return false;
if (m_data2DItem->upperX() != m_data2DItem->xMax())
return false;
if (m_data2DItem->lowerY() != m_data2DItem->yMin())
return false;
if (m_data2DItem->upperY() != m_data2DItem->yMax())
return false;
return true;
}
void MaskEditorCanvas::setZoomToROI()
{
if (MaskContainerItem* maskContainer = m_data2DItem->maskContainerItem()) {
......
......@@ -52,7 +52,6 @@ public slots:
void onResetViewRequest();
private:
bool isAxisRangeMatchData() const;
void setZoomToROI();
MaskGraphicsScene* m_scene;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment