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

replace 'm_liveProjection' by 'm_live_projection'

parent 9f4ee6a2
No related branches found
No related tags found
1 merge request!2290replace camel case in member vars; simplify updateCanvas API
......@@ -112,36 +112,36 @@ void ProjectionsEditorCanvas::resetCanvas()
void ProjectionsEditorCanvas::onEnteringColorMap()
{
if (m_liveProjection)
if (m_live_projection)
return;
if (m_currentActivity == MaskFlags::HORIZONTAL_LINE_MODE)
m_liveProjection = std::make_unique<HorizontalLineItem>();
m_live_projection = std::make_unique<HorizontalLineItem>();
else if (m_currentActivity == MaskFlags::VERTICAL_LINE_MODE)
m_liveProjection = std::make_unique<VerticalLineItem>();
m_live_projection = std::make_unique<VerticalLineItem>();
if (m_liveProjection) {
m_liveProjection->setIsVisible(false);
emit m_data_item->projectionPositionChanged(m_liveProjection.get());
if (m_live_projection) {
m_live_projection->setIsVisible(false);
emit m_data_item->projectionPositionChanged(m_live_projection.get());
}
}
void ProjectionsEditorCanvas::onLeavingColorMap()
{
if (m_liveProjection) {
disconnect(m_liveProjection.get(), nullptr, m_data_item, nullptr);
emit m_data_item->projectionGone(m_liveProjection.get());
m_liveProjection.reset();
if (m_live_projection) {
disconnect(m_live_projection.get(), nullptr, m_data_item, nullptr);
emit m_data_item->projectionGone(m_live_projection.get());
m_live_projection.reset();
}
}
void ProjectionsEditorCanvas::onPositionChanged(double x, double y)
{
if (m_liveProjection) {
if (m_live_projection) {
if (m_currentActivity == MaskFlags::HORIZONTAL_LINE_MODE)
dynamic_cast<HorizontalLineItem*>(m_liveProjection.get())->setPos(y);
dynamic_cast<HorizontalLineItem*>(m_live_projection.get())->setPos(y);
else if (m_currentActivity == MaskFlags::VERTICAL_LINE_MODE)
dynamic_cast<VerticalLineItem*>(m_liveProjection.get())->setPos(x);
dynamic_cast<VerticalLineItem*>(m_live_projection.get())->setPos(x);
}
}
......
......@@ -61,7 +61,7 @@ private:
MaskGraphicsView* m_view;
PlotStatusLabel* m_status_label;
Data2DItem* m_data_item;
std::unique_ptr<LineItem> m_liveProjection; //!< temporary, matching mouse move
std::unique_ptr<LineItem> m_live_projection; //!< temporary, matching mouse move
MaskFlags::MaskMode m_currentActivity;
};
......
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