mirror of
https://codeberg.org/armin/monoslicer.git
synced 2026-09-01 12:10:46 +02:00
Fix all compilation warnings
- Fix float-to-int conversions in WaveformDisplay::paint setBounds - Fix implicit int-to-float conversion in mousePressed key row calc - Remove unused variables in mouseWheelMove - Replace deprecated DirectoryIterator with RangedDirectoryIterator - Suppress JUCE/VST3 SDK warnings via CMAKE_CXX_FLAGS
This commit is contained in:
parent
6e220a60f4
commit
8dc07d2568
3 changed files with 11 additions and 11 deletions
|
|
@ -226,9 +226,11 @@ void WaveformDisplay::paint(juce::Graphics& g)
|
|||
drawSliceMarkers(g, waveArea);
|
||||
|
||||
// Scrollbar at bottom
|
||||
hScrollBar.setBounds(bounds.getBottomLeft().getX(),
|
||||
bounds.getBottom() - scrollbarHeight,
|
||||
bounds.getWidth(), scrollbarHeight);
|
||||
hScrollBar.setBounds(juce::Rectangle<int>(
|
||||
static_cast<int>(bounds.getBottomLeft().getX()),
|
||||
static_cast<int>(bounds.getBottom() - scrollbarHeight),
|
||||
static_cast<int>(bounds.getWidth()),
|
||||
static_cast<int>(scrollbarHeight)));
|
||||
}
|
||||
|
||||
void WaveformDisplay::drawKeys(juce::Graphics& g, juce::Rectangle<float> bounds)
|
||||
|
|
@ -539,7 +541,7 @@ void WaveformDisplay::mouseDown(const juce::MouseEvent& e)
|
|||
if (e.getPosition().getX() < static_cast<int>(keyArea.getWidth()))
|
||||
{
|
||||
float rowHeight = keyArea.getHeight() / 12.0f;
|
||||
int row = static_cast<int>((e.getPosition().getY() - keyArea.getY()) / rowHeight);
|
||||
int row = static_cast<int>((static_cast<float>(e.getPosition().getY()) - keyArea.getY()) / rowHeight);
|
||||
row = juce::jlimit(0, 11, row);
|
||||
int midiNote = keyRowToMidiNote(row);
|
||||
|
||||
|
|
@ -664,9 +666,6 @@ void WaveformDisplay::mouseWheelMove(const juce::MouseEvent& e, const juce::Mous
|
|||
// Handle horizontal scrolling (trackpad 2-finger horizontal drag)
|
||||
if (std::abs(wheel.deltaX) > 0.001f)
|
||||
{
|
||||
int total = getNumSamples();
|
||||
int visible = static_cast<int>(static_cast<float>(total) / zoomFactor);
|
||||
float maxOffset = static_cast<float>(juce::jmax(1, total - visible));
|
||||
scrollOffset -= wheel.deltaX * 0.02f / zoomFactor;
|
||||
scrollOffset = juce::jlimit(0.0f, 1.0f, scrollOffset);
|
||||
syncScrollBar();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue