Skip to content

Commit

Permalink
Small improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Hussam Eddin Alhomsi committed Apr 22, 2018
1 parent d1dfe32 commit 19b0342
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion include/AutomationEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ protected slots:

// some constants...
static const int SCROLLBAR_SIZE = 12;
static const int LEFT_MARGIN = 63;
static const int TOP_MARGIN = 16;

static const int DEFAULT_Y_DELTA = 6;
Expand Down
5 changes: 2 additions & 3 deletions src/gui/editors/AutomationEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,7 +1084,6 @@ inline void AutomationEditor::drawCross( QPainter & p )
/ (float)( m_maxLevel - m_minLevel ) ) :
grid_bottom - ( level - m_bottomLevel ) * m_y_delta;

int right_margin = width() - SCROLLBAR_SIZE;
int bottom_margin = height() - SCROLLBAR_SIZE;

p.setPen( crossColor() );
Expand All @@ -1099,8 +1098,8 @@ inline void AutomationEditor::drawCross( QPainter & p )
float scaledLevel = m_pattern->firstObject()->scaledValue( level );

// Limit the scaled-level tooltip to the grid
if( mouse_pos.x() > LEFT_MARGIN &&
mouse_pos.x() < right_margin &&
if( mouse_pos.x() > VALUES_WIDTH - 1 && // left_margin
mouse_pos.x() < width() - SCROLLBAR_SIZE && // right_margin
mouse_pos.y() > TOP_MARGIN &&
mouse_pos.y() < bottom_margin )
{
Expand Down

0 comments on commit 19b0342

Please sign in to comment.