@@ -158,6 +158,7 @@ struct Button : OpaqueWidget { | |||||
}; | }; | ||||
struct IconButton : Button { | struct IconButton : Button { | ||||
FramebufferWidget *fw; | |||||
SVGWidget *sw; | SVGWidget *sw; | ||||
IconButton(); | IconButton(); | ||||
void setSVG(std::shared_ptr<SVG> svg); | void setSVG(std::shared_ptr<SVG> svg); | ||||
@@ -6,13 +6,19 @@ namespace rack { | |||||
IconButton::IconButton() { | IconButton::IconButton() { | ||||
box.size.x = BND_TOOL_WIDTH; | box.size.x = BND_TOOL_WIDTH; | ||||
fw = new FramebufferWidget(); | |||||
fw->oversample = 2; | |||||
addChild(fw); | |||||
sw = new SVGWidget(); | sw = new SVGWidget(); | ||||
sw->box.pos = Vec(2, 2); | sw->box.pos = Vec(2, 2); | ||||
addChild(sw); | |||||
fw->addChild(sw); | |||||
} | } | ||||
void IconButton::setSVG(std::shared_ptr<SVG> svg) { | void IconButton::setSVG(std::shared_ptr<SVG> svg) { | ||||
sw->setSVG(svg); | sw->setSVG(svg); | ||||
fw->dirty = true; | |||||
} | } | ||||