Skip to content

Commit f64cf98

Browse files
committed
ensure selected effect appears in effect view
1 parent f46ba62 commit f64cf98

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/main/java/org/emrick/project/MediaEditorGUI.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,23 +2157,23 @@ public boolean isPlaying() {
21572157

21582158
@Override
21592159
public void onPressEffect(Effect effect) {
2160+
// selcting first ensures the effect appears on the Effect View
2161+
// search all ledstrips for the effect and select them if found
2162+
if (effectManager != null) {
2163+
ArrayList<LEDStrip> ledStrips = effectManager.getLEDStripsWithEffect(effect);
2164+
if (!ledStrips.isEmpty()) {
2165+
onGroupSelection(ledStrips.toArray(new LEDStrip[ledStrips.size()]));
2166+
}
2167+
}
2168+
21602169
// scrub to this effect
21612170
// make effects based on count pls
21622171
int count = 0;
21632172
long ms = effect.getStartTimeMSec();
2164-
// get count of the ms using the timemanager
21652173
if (timeManager != null) {
21662174
count = timeManager.MSec2Count(ms);
21672175
}
21682176
scrubBarGUI.setScrub(count-1);
2169-
2170-
// search all ledstrips for the effect and select them if found
2171-
if (effectManager != null) {
2172-
ArrayList<LEDStrip> ledStrips = effectManager.getLEDStripsWithEffect(effect);
2173-
if (!ledStrips.isEmpty()) {
2174-
onGroupSelection(ledStrips.toArray(new LEDStrip[ledStrips.size()]));
2175-
}
2176-
}
21772177
}
21782178

21792179
/**

0 commit comments

Comments
 (0)