MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / draw

Method draw

plugins/Cardinal/src/AIDA-X.cpp:949–1060  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

947 }
948
949 void draw(const DrawArgs& args) override
950 {
951 const int cornerRadius = 12;
952
953 // load images as needed
954 if (images.background.get() == nullptr)
955 images.background = APP->window->loadImage(asset::plugin(pluginInstance, "res/aida-x-background-p2.png"));
956
957 // background gradient
958 nvgBeginPath(args.vg);
959 nvgRect(args.vg, 0, 0, box.size.x, box.size.y);
960
961 nvgFillPaint(args.vg,
962 nvgLinearGradient(args.vg,
963 0, 0,
964 box.size.x * 0.52f, 0,
965 nvgRGB(28, 23, 12),
966 nvgRGB(42, 34, 15)));
967 nvgFill(args.vg);
968
969 nvgFillPaint(args.vg,
970 nvgLinearGradient(args.vg,
971 box.size.x * 0.5f, 0,
972 box.size.x, 0,
973 nvgRGB(42, 34, 15),
974 nvgRGB(19, 19, 19)));
975 nvgFill(args.vg);
976
977 // splitter
978 nvgBeginPath(args.vg);
979 nvgMoveTo(args.vg, 226, box.size.y - 80);
980 nvgLineTo(args.vg, 226, box.size.y - 32);
981 nvgLineCap(args.vg, NVG_ROUND);
982 nvgStrokeColor(args.vg, nvgRGBA(97, 97, 97, 123));
983 nvgStrokeWidth(args.vg, 2);
984 nvgStroke(args.vg);
985
986 // .rt-neural .background_head
987 nvgBeginPath(args.vg);
988 nvgRoundedRect(args.vg,
989 kPedalMargin * 2,
990 kPedalMargin + kPedalMarginVertical,
991 box.size.x - kPedalMargin * 4,
992 kFileListHeight,
993 cornerRadius);
994 nvgFillPaint(args.vg,
995 nvgLinearGradient(args.vg,
996 kPedalMargin * 2,
997 kPedalMargin + kPedalMarginVertical,
998 kPedalMargin * 2,
999 kPedalMargin + kPedalMarginVertical + kFileListHeight,
1000 nvgRGB(0x8b, 0xf7, 0x00),
1001 nvgRGB(0xcd, 0xff, 0x05)));
1002 nvgFill(args.vg);
1003
1004 if (Image* const img = images.background.get())
1005 {
1006 nvgFillPaint(args.vg, nvgImagePattern(args.vg,

Callers

nothing calls this directly

Calls 15

nvgBeginPathFunction · 0.85
nvgRectFunction · 0.85
nvgFillPaintFunction · 0.85
nvgRGBFunction · 0.85
nvgFillFunction · 0.85
nvgStrokeColorFunction · 0.85
nvgRGBAFunction · 0.85
nvgStrokeWidthFunction · 0.85
nvgStrokeFunction · 0.85
nvgRoundedRectFunction · 0.85
nvgImagePatternFunction · 0.85
nvgRGBAfFunction · 0.85

Tested by

no test coverage detected