diff options
author | rj <rj@rj> | 2013-10-08 23:12:32 +0200 |
---|---|---|
committer | rj <rj@rj> | 2013-10-08 23:12:32 +0200 |
commit | 36b8a8d42f6f24997e6de715de55f52c413b03a2 (patch) | |
tree | ec7a03242b3bb3dbdef30af6cdb2072e62dd964c /muse2/muse | |
parent | 3ff42facba9ce594c9fe616953c06406fc686759 (diff) |
minor fix to length of line
Diffstat (limited to 'muse2/muse')
-rw-r--r-- | muse2/muse/master/master.cpp | 13 |
1 files 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; |