diff --git a/include/ui.hpp b/include/ui.hpp index a720ceb7..abd12899 100644 --- a/include/ui.hpp +++ b/include/ui.hpp @@ -158,6 +158,7 @@ struct Button : OpaqueWidget { }; struct IconButton : Button { + FramebufferWidget *fw; SVGWidget *sw; IconButton(); void setSVG(std::shared_ptr svg); diff --git a/src/ui/IconButton.cpp b/src/ui/IconButton.cpp index aacbab3f..9150f15a 100644 --- a/src/ui/IconButton.cpp +++ b/src/ui/IconButton.cpp @@ -6,13 +6,19 @@ namespace rack { IconButton::IconButton() { box.size.x = BND_TOOL_WIDTH; + + fw = new FramebufferWidget(); + fw->oversample = 2; + addChild(fw); + sw = new SVGWidget(); sw->box.pos = Vec(2, 2); - addChild(sw); + fw->addChild(sw); } void IconButton::setSVG(std::shared_ptr svg) { sw->setSVG(svg); + fw->dirty = true; }