summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-05-26 03:11:22 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-05-26 03:29:08 +0200
commit257510bffb75eb11d759db7d86b78861b49e921e (patch)
tree84e75b3d8422926c9acf5c6c369c7692dd0f25d6 /chart2
parentb8dc914cdc0eab0735e4fec7613221fef2fc0fdb (diff)
block user input while we are in another user interaction
Change-Id: I25a846b0648d2d28585a58066a9bb1088d607c24
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/view/charttypes/GL3DBarChart.cxx16
-rw-r--r--chart2/source/view/inc/GL3DBarChart.hxx1
2 files changed, 16 insertions, 1 deletions
diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 951188d9df09..73a41d843708 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -34,7 +34,8 @@ GL3DBarChart::GL3DBarChart(
mpTextCache(new opengl3D::TextCache()),
mnStep(0),
mnStepsTotal(0),
- mnCornerId(0)
+ mnCornerId(0),
+ mbBlockUserInput(false)
{
Size aSize = mrWindow.GetSizePixel();
mpRenderer->SetSize(aSize);
@@ -307,6 +308,10 @@ public:
void GL3DBarChart::clickedAt(const Point& /*rPos*/)
{
+ if(mbBlockUserInput)
+ return;
+
+ mbBlockUserInput = true;
sal_uInt32 nId = 5;
/*
{
@@ -344,6 +349,10 @@ void GL3DBarChart::clickedAt(const Point& /*rPos*/)
void GL3DBarChart::mouseDragMove(const Point& rStartPos, const Point& rEndPos, sal_uInt16 nButtons)
{
+ if(mbBlockUserInput)
+ return;
+
+ mbBlockUserInput = true;
SAL_WARN("chart2.opengl", "Dragging: " << rStartPos << " to : " << rEndPos << " Buttons: " << nButtons);
if(nButtons == MOUSE_RIGHT)
{
@@ -413,6 +422,7 @@ IMPL_LINK_NOARG(GL3DBarChart, MoveCamera)
}
else
{
+ mbBlockUserInput = false;
mnStep = 0;
}
@@ -434,6 +444,7 @@ IMPL_LINK_NOARG(GL3DBarChart, MoveToBar)
else
{
maShapes.pop_back();
+ mbBlockUserInput = false;
mnStep = 0;
}
@@ -442,6 +453,9 @@ IMPL_LINK_NOARG(GL3DBarChart, MoveToBar)
void GL3DBarChart::scroll(long nDelta)
{
+ if(mbBlockUserInput)
+ return;
+
glm::vec3 maDir = glm::normalize(maCameraPosition - maCameraDirection);
maCameraPosition -= (float((nDelta/10)) * maDir);
mpCamera->setPosition(maCameraPosition);
diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx
index 1f54cc63a649..377b18cd6c18 100644
--- a/chart2/source/view/inc/GL3DBarChart.hxx
+++ b/chart2/source/view/inc/GL3DBarChart.hxx
@@ -107,6 +107,7 @@ private:
std::map<sal_uInt32, const BarInformation> maBarMap;
+ bool mbBlockUserInput;
};
}