Skip to content

Commit

Permalink
Piano: Add nice scale factor to WaveWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcpherson2 authored and awesomekling committed Feb 10, 2020
1 parent 2a66878 commit 255edcb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Applications/Piano/WaveWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ WaveWidget::~WaveWidget()

int WaveWidget::sample_to_y(int sample) const
{
constexpr int nice_scale_factor = 4;
sample *= nice_scale_factor;
constexpr double sample_max = std::numeric_limits<i16>::max();
double percentage = sample / sample_max;
double portion_of_half_height = percentage * ((frame_inner_rect().height() - 1) / 2.0);
Expand Down

0 comments on commit 255edcb

Please sign in to comment.