From 550e47096f827c828f5e9abec4dc6b6e7a247e49 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Thu, 7 Jun 2018 09:49:54 -0400 Subject: [PATCH] Use Framebuffer for IconButton SVG --- include/ui.hpp | 1 + src/ui/IconButton.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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; }