Clean up code for custom slide GUIs
Bailing out early caused controls to flicker on/off if one was being
interacted with. No need to rebuild the window (paramsChanged), the GUI
is up, so we're already repainting.
Change-Id: I0751271962075dff22b19f60f4d1dc81c9232f58
Reviewed-on: https://skia-review.googlesource.com/145335
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index f88dfbb..05a030c 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -1670,19 +1670,17 @@
const char* name;
SkMetaData::Type type;
int count;
- bool found = false;
- while ((name = iter.next(&type, &count)) != nullptr && found == false) {
+ while ((name = iter.next(&type, &count)) != nullptr) {
if (type == SkMetaData::kScalar_Type) {
float val[3];
SkASSERT(count == 3);
controls.findScalars(name, &count, val);
if (ImGui::SliderFloat(name, &val[0], val[1], val[2])) {
controls.setScalars(name, 3, val);
- fSlides[fCurrentSlide]->onSetControls(controls);
- found = paramsChanged = true;
}
}
}
+ fSlides[fCurrentSlide]->onSetControls(controls);
}
}
}