mirror of
https://codeberg.org/armin/monoslicer.git
synced 2026-09-01 04:10:45 +02:00
Reduce plugin width by 102px and fix bottom panel layout to scale proportionally
This commit is contained in:
parent
d9302ad77a
commit
f035e89ba9
9 changed files with 305 additions and 106 deletions
|
|
@ -27,11 +27,12 @@ juce::Colour PianoRollDisplay::sliceColour(int sliceIndex) const
|
|||
|
||||
int PianoRollDisplay::rowToSliceIndex(int row) const
|
||||
{
|
||||
int noteRow = numRows - 1 - row;
|
||||
const int baseMidiNote = 60;
|
||||
int midiNote = baseMidiNote + (numRows - 1 - row);
|
||||
const auto& slices = sliceManager.getSlices();
|
||||
for (int i = 0; i < sliceManager.getNumSlices(); ++i)
|
||||
{
|
||||
if (slices[static_cast<size_t>(i)].midiNote % numRows == noteRow)
|
||||
if (slices[static_cast<size_t>(i)].midiNote == midiNote)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
|
|
@ -68,7 +69,8 @@ void PianoRollDisplay::paint(juce::Graphics& g)
|
|||
for (int i = 0; i < numSlices; ++i)
|
||||
{
|
||||
const auto& slice = slices[static_cast<size_t>(i)];
|
||||
int noteRow = slice.midiNote % numRows;
|
||||
const int baseMidiNote = 60;
|
||||
int noteRow = slice.midiNote - baseMidiNote;
|
||||
int row = numRows - 1 - noteRow;
|
||||
|
||||
float xFrac = static_cast<float>(slice.startSample) / static_cast<float>(total);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue