From 36b8a8d42f6f24997e6de715de55f52c413b03a2 Mon Sep 17 00:00:00 2001 From: rj Date: Tue, 8 Oct 2013 23:12:32 +0200 Subject: minor fix to length of line --- muse2/muse/master/master.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/muse2/muse/master/master.cpp b/muse2/muse/master/master.cpp index 712d2985..01bae00a 100644 --- a/muse2/muse/master/master.cpp +++ b/muse2/muse/master/master.cpp @@ -206,6 +206,7 @@ void Master::pdraw(QPainter& p, const QRect& rect) p.setPen(Qt::blue); p.drawLine(xp, y, xp, y+h); } + } //--------------------------------------------------------- @@ -220,11 +221,12 @@ void Master::draw(QPainter& p, const QRect& rect) if ((tool == MusEGui::DrawTool) && drawLineMode) { p.setPen(Qt::black); p.drawLine(line1x, line1y, line2x, line2y); + p.drawLine(line1x, line1y+1, line2x, line2y+1); } } - //--------------------------------------------------------- -// changeValRamp +//--------------------------------------------------------- +// newValRamp //--------------------------------------------------------- void Master::newValRamp(int x1, int y1, int x2, int y2) @@ -247,7 +249,7 @@ void Master::newValRamp(int x1, int y1, int x2, int y2) int stick = mapx(i->second->tick); int startOldTick = i->second->tick; //printf("stick=%d startOldTick=%d tickEnd=%d\n",stick, startOldTick, tickEnd); - if (startOldTick > tickStart && startOldTick < tickEnd ) { + if (startOldTick > tickStart && startOldTick <= tickEnd ) { operations.push_back(MusECore::UndoOp(MusECore::UndoOp::DeleteTempo, startOldTick, e->tempo)); //printf("tempo = %f %d %d\n", 60000000.0/e->tempo, endOldTick, startOldTick); } @@ -256,8 +258,9 @@ void Master::newValRamp(int x1, int y1, int x2, int y2) int priorTick = editor->rasterVal1(x1); int tempoVal = int(60000000000.0/(280000 - y1)); operations.push_back(MusECore::UndoOp(MusECore::UndoOp::AddTempo, tickStart, tempoVal)); - for (int i = x1; i < x2; i++) { - int tick = editor->rasterVal1(i); + int tick = editor->rasterVal1(x1); + for (int i = x1; tick < tickEnd; i++) { + tick = editor->rasterVal1(i); if (tick > priorTick) { double xproportion = double(tick-tickStart)/double(tickEnd-tickStart); int yproportion = double(y2 - y1) * xproportion; -- cgit v1.2.1