| 807 | } |
| 808 | |
| 809 | void draw(const DrawArgs& args) override |
| 810 | { |
| 811 | if (image.get() == nullptr) |
| 812 | image = APP->window->loadImage(asset::plugin(pluginInstance, "res/aida-x-logo.png")); |
| 813 | |
| 814 | if (Image* const img = image.get()) |
| 815 | { |
| 816 | const float pixelRatio = hasModule ? APP->window->pixelRatio : 1.0f; |
| 817 | const float boxscale = std::min(box.size.x / 111, box.size.y / 25); |
| 818 | const float imgHeight = (25 / pixelRatio) * boxscale; |
| 819 | nvgBeginPath(args.vg); |
| 820 | nvgRect(args.vg, 0, 0, box.size.x, box.size.y); |
| 821 | nvgFillPaint(args.vg, nvgImagePattern(args.vg, |
| 822 | 0, |
| 823 | (box.size.y / pixelRatio) * 0.5f - imgHeight * 0.5f, |
| 824 | box.size.x / pixelRatio, |
| 825 | imgHeight, 0, img->handle, 1.0f)); |
| 826 | nvgFill(args.vg); |
| 827 | } |
| 828 | } |
| 829 | }; |
| 830 | |
| 831 | struct AidaKnob : app::SvgKnob { |
nothing calls this directly
no test coverage detected