summaryrefslogtreecommitdiff
path: root/dgedit/canvastoollisten.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2011-10-02 09:58:10 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2011-10-02 09:58:10 +0200
commitf474c3c923fe5bb27c1ee11e2c6dd57e41889f27 (patch)
tree93e2a3e2624bb2e4d238d22124956cd066643b03 /dgedit/canvastoollisten.cc
parent83807cf93ef362098d6fea6030646653cc62e37f (diff)
Made conenctions for CanvasTool work (again...).
Diffstat (limited to 'dgedit/canvastoollisten.cc')
-rw-r--r--dgedit/canvastoollisten.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/dgedit/canvastoollisten.cc b/dgedit/canvastoollisten.cc
index 74bf176..4254137 100644
--- a/dgedit/canvastoollisten.cc
+++ b/dgedit/canvastoollisten.cc
@@ -86,6 +86,7 @@ CanvasToolListen::CanvasToolListen(Canvas *c)
bool CanvasToolListen::mousePressEvent(QMouseEvent *event)
{
+ if(!isActive()) return false;
player.pos = canvas->unmapX(event->x());
player.playing = true;
canvas->update();
@@ -95,6 +96,7 @@ bool CanvasToolListen::mousePressEvent(QMouseEvent *event)
bool CanvasToolListen::mouseReleaseEvent(QMouseEvent *event)
{
+ if(!isActive()) return false;
player.playing = false;
timer.stop();
lastpos = 0;
@@ -104,6 +106,8 @@ bool CanvasToolListen::mouseReleaseEvent(QMouseEvent *event)
void CanvasToolListen::paintEvent(QPaintEvent *event, QPainter &painter)
{
+ if(!isActive()) return;
+
if(player.playing) {
painter.setPen(QColor(0, 127, 127));
painter.drawLine(canvas->mapX(player.pos),