Mercurial > hg > svgui
comparison layer/TimeValueLayer.cpp @ 430:bcaeb2ba9b74
* some plotting tweaks
author | Chris Cannam |
---|---|
date | Fri, 10 Oct 2008 16:03:48 +0000 |
parents | 1304dbe4542e |
children | 4ceb5264404d |
comparison
equal
deleted
inserted
replaced
429:427e5c58658e | 430:bcaeb2ba9b74 |
---|---|
638 } else { | 638 } else { |
639 paint.setBrush(brushColour); | 639 paint.setBrush(brushColour); |
640 } | 640 } |
641 | 641 |
642 if (m_plotStyle == PlotStems) { | 642 if (m_plotStyle == PlotStems) { |
643 /* | |
643 paint.setPen(brushColour); | 644 paint.setPen(brushColour); |
644 if (y < origin - 1) { | 645 if (y < origin - 1) { |
645 paint.drawRect(x + w/2, y + 1, 1, origin - y); | 646 paint.drawRect(x + w/2, y + 1, 1, origin - y); |
646 } else if (y > origin + 1) { | 647 } else if (y > origin + 1) { |
647 paint.drawRect(x + w/2, origin, 1, y - origin - 1); | 648 paint.drawRect(x + w/2, origin, 1, y - origin - 1); |
648 } | 649 } |
650 */ | |
649 paint.setPen(getBaseQColor()); | 651 paint.setPen(getBaseQColor()); |
652 if (y < origin - 1) { | |
653 paint.drawLine(x + w/2, y + 1, x + w/2, origin); | |
654 } else if (y > origin + 1) { | |
655 paint.drawLine(x + w/2, origin, x + w/2, y - 1); | |
656 } | |
650 } | 657 } |
651 | 658 |
652 if (illuminateFrame == p.frame) { | 659 if (illuminateFrame == p.frame) { |
653 | 660 |
654 //!!! aside from the problem of choosing a colour, it'd be | 661 //!!! aside from the problem of choosing a colour, it'd be |
685 paint.setPen(brushColour); | 692 paint.setPen(brushColour); |
686 paint.drawLine(x + w, y, nx, ny); | 693 paint.drawLine(x + w, y, nx, ny); |
687 paint.restore(); | 694 paint.restore(); |
688 | 695 |
689 } else if (m_plotStyle == PlotLines) { | 696 } else if (m_plotStyle == PlotLines) { |
690 | 697 |
691 paint.drawLine(x + w/2, y, nx + w/2, ny); | 698 if (pointCount == 0) { |
699 path.moveTo(x + w/2, y); | |
700 } | |
701 ++pointCount; | |
702 | |
703 // paint.drawLine(x + w/2, y, nx + w/2, ny); | |
704 path.lineTo(nx + w/2, ny); | |
692 | 705 |
693 } else { | 706 } else { |
694 | 707 |
695 float x0 = x + float(w)/2; | 708 float x0 = x + float(w)/2; |
696 float x1 = nx + float(w)/2; | 709 float x1 = nx + float(w)/2; |
737 paint.drawText(x + 5, textY, p.label); | 750 paint.drawText(x + 5, textY, p.label); |
738 } | 751 } |
739 } | 752 } |
740 } | 753 } |
741 | 754 |
742 if (m_plotStyle == PlotCurve && !path.isEmpty()) { | 755 if ((m_plotStyle == PlotCurve || m_plotStyle == PlotLines) |
756 && !path.isEmpty()) { | |
743 paint.setRenderHint(QPainter::Antialiasing, pointCount <= v->width()); | 757 paint.setRenderHint(QPainter::Antialiasing, pointCount <= v->width()); |
744 paint.drawPath(path); | 758 paint.drawPath(path); |
745 } | 759 } |
746 | 760 |
747 paint.restore(); | 761 paint.restore(); |