From a8e9efda7520f3112b392ca67683a39c6a017a1d Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 22 Jun 2014 15:58:45 +0100 Subject: [PATCH] Fix build --- .../jucepluginhost/juce_MidiKeyboardComponent.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/source/modules/native-plugins/jucepluginhost/juce_MidiKeyboardComponent.cpp b/source/modules/native-plugins/jucepluginhost/juce_MidiKeyboardComponent.cpp index fc9b90e9e..fae07b732 100644 --- a/source/modules/native-plugins/jucepluginhost/juce_MidiKeyboardComponent.cpp +++ b/source/modules/native-plugins/jucepluginhost/juce_MidiKeyboardComponent.cpp @@ -211,19 +211,11 @@ void MidiKeyboardComponent::getKeyPosition (int midiNoteNumber, const float keyW 5.0f, 6 - blackNoteWidth * 0.3f, 6.0f }; - static const float widths[] = { 1.0f, blackNoteWidth, - 1.0f, blackNoteWidth, - 1.0f, - 1.0f, blackNoteWidth, - 1.0f, blackNoteWidth, - 1.0f, blackNoteWidth, - 1.0f }; - const int octave = midiNoteNumber / 12; const int note = midiNoteNumber % 12; x = roundToInt (octave * 7.0f * keyWidth_ + notePos [note] * keyWidth_); - w = roundToInt (widths [note] * keyWidth_); + w = roundToInt (MidiMessage::isMidiNoteBlack (note) ? blackNoteWidth * keyWidth_ : keyWidth_); } void MidiKeyboardComponent::getKeyPos (int midiNoteNumber, int& x, int& w) const @@ -824,7 +816,7 @@ void MidiKeyboardComponent::timerCallback() const Array& mouseSources = Desktop::getInstance().getMouseSources(); for (MouseInputSource* mi = mouseSources.begin(), * const e = mouseSources.end(); mi != e; ++mi) - updateNoteUnderMouse (getLocalPoint (nullptr, mi->getScreenPosition()), mi->isDragging(), mi->getIndex()); + updateNoteUnderMouse (getLocalPoint (nullptr, mi->getScreenPosition()).roundToInt(), mi->isDragging(), mi->getIndex()); } }