Skip to content
Permalink
Browse files

Change layer not visible warning conditions

Now it produces a warning when you try to zoom/pan on a hidden
camera layer and does not produce a warning when panning with the
middle mouse button on a non-camera layer.
  • Loading branch information...
scribblemaniac committed Apr 15, 2019
1 parent c0af82a commit e1db3a797daa8c5e78f86ce9b8deb635389a8ba9
Showing with 9 additions and 1 deletion.
  1. +9 −1 core_lib/src/interface/scribblearea.cpp
@@ -380,6 +380,13 @@ void ScribbleArea::wheelEvent(QWheelEvent* event)
// Don't change view if tool is in use
if (mMouseInUse) return;

Layer* layer = mEditor->layers()->currentLayer();
if (layer->type() == Layer::CAMERA && !layer->visible())
{
showLayerNotVisibleWarning(); // FIXME: crash when using tablets
return;
}

const QPoint pixels = event->pixelDelta();
const QPoint angle = event->angleDelta();
//qDebug() <<"angle"<<angle<<"pixels"<<pixels;
@@ -476,7 +483,8 @@ void ScribbleArea::pointerPressEvent(PointerEvent* event)
return;
}

if (currentTool()->type() != HAND && (event->button() != Qt::RightButton))
bool isCameraLayer = mEditor->layers()->currentLayer()->type() == Layer::CAMERA;
if ((currentTool()->type() != HAND || isCameraLayer) && (event->button() != Qt::RightButton) && (event->button() != Qt::MidButton || isCameraLayer))
{
Layer* layer = mEditor->layers()->currentLayer();
if (!layer->visible())

0 comments on commit e1db3a7

Please sign in to comment.
You can’t perform that action at this time.