Skip to content

Commit

Permalink
More sensitve and 1 note drop. Move themse to sctheme extension (#1138)
Browse files Browse the repository at this point in the history
- The drop a file gesture now is more sensitive allowing finer
  control over small width regions but also allowing a 1-wide
  drop. Closes #1131
- .sctheme is the expension for colormaps
  • Loading branch information
baconpaul authored Aug 17, 2024
1 parent b4a0a3e commit b8c3e5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src-ui/components/SCXTEditorMenus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void SCXTEditor::addUIThemesMenu(juce::PopupMenu &p, bool addTitle)
if (!w)
return;
w->fileChooser = std::make_unique<juce::FileChooser>(
"Save Theme", juce::File(w->browser.themeDirectory.u8string()), "*.json");
"Save Theme", juce::File(w->browser.themeDirectory.u8string()), "*.sctheme");
w->fileChooser->launchAsync(juce::FileBrowserComponent::canSelectFiles |
juce::FileBrowserComponent::saveMode |
juce::FileBrowserComponent::warnAboutOverwriting,
Expand All @@ -274,7 +274,7 @@ void SCXTEditor::addUIThemesMenu(juce::PopupMenu &p, bool addTitle)
if (!w)
return;
w->fileChooser = std::make_unique<juce::FileChooser>(
"Load Theme", juce::File(w->browser.themeDirectory.u8string()), "*.json");
"Load Theme", juce::File(w->browser.themeDirectory.u8string()), "*.sctheme");
w->fileChooser->launchAsync(
juce::FileBrowserComponent::canSelectFiles | juce::FileBrowserComponent::openMode,
[w](const juce::FileChooser &c) {
Expand Down
2 changes: 1 addition & 1 deletion src-ui/components/multi/MappingPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1760,7 +1760,7 @@ std::array<int16_t, 3> MappingZones::rootAndRangeForPosition(const juce::Point<i
(float)Keyboard::firstMidiNote, (float)Keyboard::lastMidiNote);

auto fromTop = std::clamp(p.getY(), 0, getHeight()) * 1.f / getHeight();
auto span = (1.0f - fromTop) * 80 + 1;
auto span = (1.0f - sqrt(fromTop)) * 80;
auto low = std::clamp(rootKey - span, 0.f, 127.f);
auto high = std::clamp(rootKey + span, 0.f, 127.f);
return {(int16_t)rootKey, (int16_t)low, (int16_t)high};
Expand Down

0 comments on commit b8c3e5a

Please sign in to comment.