MCPcopy Create free account
hub / github.com/baconpaul/airwin2rack / draw

Method draw

src-rack/Module.cpp:1877–1916  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1875 {
1876 HelpWidget *hw{nullptr};
1877 void draw(const DrawArgs &args)
1878 {
1879 assert(hw);
1880 auto vg = args.vg;
1881
1882 int yp = 3;
1883 auto fid = APP->window->loadFont(awSkin.fontPath)->handle;
1884 auto fidm = APP->window->loadFont(awSkin.fontPathMedium)->handle;
1885
1886 nvgBeginPath(vg);
1887 nvgFillColor(vg, awSkin.helpText());
1888 nvgTextAlign(vg, NVG_ALIGN_TOP | NVG_ALIGN_LEFT);
1889
1890 float bnd[6];
1891 nvgSave(vg);
1892 nvgScale(vg, APP->scene->rackScroll->getZoom(), APP->scene->rackScroll->getZoom());
1893 nvgFontSize(vg, 14);
1894 nvgFontFaceId(vg, fid);
1895 nvgTextBox(vg, margin + 2, margin + 2,
1896 box.size.x / APP->scene->rackScroll->getZoom() - 2 * (margin + 2),
1897 hw->helpTitle.c_str(), nullptr);
1898 nvgTextBoxBounds(vg, margin + 2, margin + 2,
1899 box.size.x / APP->scene->rackScroll->getZoom() - 2 * (margin + 2),
1900 hw->helpTitle.c_str(), nullptr, bnd);
1901 nvgRestore(vg);
1902
1903 nvgSave(vg);
1904 nvgScale(vg, APP->scene->rackScroll->getZoom(), APP->scene->rackScroll->getZoom());
1905 nvgFontSize(vg, 12);
1906 nvgFontFaceId(vg, fidm);
1907 nvgTextBox(vg, margin + 2, bnd[3] + margin + 2,
1908 box.size.x / APP->scene->rackScroll->getZoom() - 2 * (margin + 2),
1909 hw->helpText.c_str(), nullptr);
1910 nvgTextBoxBounds(vg, margin + 2, bnd[3] + margin + 2,
1911 box.size.x / APP->scene->rackScroll->getZoom() - 2 * (margin + 2),
1912 hw->helpText.c_str(), nullptr, bnd);
1913 nvgRestore(vg);
1914
1915 box.size.y = bnd[3];
1916 }
1917 } *render{nullptr};
1918
1919 void setup()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected