From 4adec737884935bf1d30586a89417ccea22ffa4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20Waldisp=C3=BChl?= Date: Thu, 19 Jul 2018 20:37:09 +0200 Subject: [PATCH] 'Double whistle' special effect can be placed out of range (fixes #48). --- intervalmusiccompositor.app/src/main/resources/CHANGELOG.txt | 1 + .../ui/soundeffects/SoundEffectEntry.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/intervalmusiccompositor.app/src/main/resources/CHANGELOG.txt b/intervalmusiccompositor.app/src/main/resources/CHANGELOG.txt index e2a98e3..03970e4 100644 --- a/intervalmusiccompositor.app/src/main/resources/CHANGELOG.txt +++ b/intervalmusiccompositor.app/src/main/resources/CHANGELOG.txt @@ -5,6 +5,7 @@ retorte laboratories (retorte.ch) IntervalMusicCompositor change log -------------------------------------------------------------------------------- ADD #47 Reduce / adapt volume of break track. FIX #46 BPM dialog: Music should stop when dialog is closed. +FIX #48 'Double whistle' special effect can be placed out of range. 2017-11-16 2.8.2 diff --git a/intervalmusiccompositor.fxUi/src/main/java/ch/retorte/intervalmusiccompositor/ui/soundeffects/SoundEffectEntry.java b/intervalmusiccompositor.fxUi/src/main/java/ch/retorte/intervalmusiccompositor/ui/soundeffects/SoundEffectEntry.java index 8da51da..c3965a4 100644 --- a/intervalmusiccompositor.fxUi/src/main/java/ch/retorte/intervalmusiccompositor/ui/soundeffects/SoundEffectEntry.java +++ b/intervalmusiccompositor.fxUi/src/main/java/ch/retorte/intervalmusiccompositor/ui/soundeffects/SoundEffectEntry.java @@ -137,7 +137,7 @@ void updateSpinnerSizeWith(int maximalTrackDuration) { } private int getLatestStartTimeWith(int maximalTrackDuration) { - return maximalTrackDuration - (int)(soundEffectOccurrence.getSoundEffect().getDurationMillis() / 1000.0); + return maximalTrackDuration - (int) Math.ceil(soundEffectOccurrence.getSoundEffect().getDurationMillis() / 1000.0); } private void updateSelectedSoundEffect() {