mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 05:40:38 +01:00
[apps] Shared: Factorize code: all FunctionGraphView have a member
indicating the selected function
This commit is contained in:
committed by
EmilieNumworks
parent
0dec52a708
commit
a6050fda55
@@ -12,8 +12,7 @@ GraphView::GraphView(SequenceStore * sequenceStore, InteractiveCurveViewRange *
|
||||
m_verticalCursor(false),
|
||||
m_highlightedDotStart(-1),
|
||||
m_highlightedDotEnd(-1),
|
||||
m_shouldColorHighlighted(false),
|
||||
m_selectedSequence(nullptr)
|
||||
m_shouldColorHighlighted(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -34,7 +33,7 @@ void GraphView::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
continue;
|
||||
}
|
||||
drawDot(ctx, rect, x, y, s->color());
|
||||
if (x >= m_highlightedDotStart && x <= m_highlightedDotEnd && s == m_selectedSequence) {
|
||||
if (x >= m_highlightedDotStart && x <= m_highlightedDotEnd && s == m_selectedFunction) {
|
||||
KDColor color = m_shouldColorHighlighted ? s->color() : KDColorBlack;
|
||||
if (y >= 0.0f) {
|
||||
drawSegment(ctx, rect, Axis::Vertical, x, 0.0f, y, color, 1);
|
||||
@@ -63,14 +62,6 @@ void GraphView::reload() {
|
||||
}
|
||||
}
|
||||
|
||||
void GraphView::selectSequence(Sequence * sequence) {
|
||||
if (m_selectedSequence != sequence) {
|
||||
reload();
|
||||
m_selectedSequence = sequence;
|
||||
reload();
|
||||
}
|
||||
}
|
||||
|
||||
void GraphView::setHighlight(int start, int end) {
|
||||
if (m_highlightedDotStart != start || m_highlightedDotEnd != end) {
|
||||
reload();
|
||||
|
||||
Reference in New Issue
Block a user