| 1162 | } |
| 1163 | |
| 1164 | void onResize(const ResizeEvent& ev) override |
| 1165 | { |
| 1166 | UI::onResize(ev); |
| 1167 | |
| 1168 | if (context->window != nullptr) |
| 1169 | WindowSetInternalSize(context->window, rack::math::Vec(ev.size.getWidth(), ev.size.getHeight())); |
| 1170 | |
| 1171 | const double scaleFactor = getScaleFactor(); |
| 1172 | const int width = static_cast<int>(ev.size.getWidth() / scaleFactor + 0.5); |
| 1173 | const int height = static_cast<int>(ev.size.getHeight() / scaleFactor + 0.5); |
| 1174 | |
| 1175 | char sizeString[64] = {}; |
| 1176 | std::snprintf(sizeString, sizeof(sizeString) - 1, "%d:%d", width, height); |
| 1177 | setState("windowSize", sizeString); |
| 1178 | |
| 1179 | if (rack::isStandalone()) |
| 1180 | rack::settings::windowSize = rack::math::Vec(width, height); |
| 1181 | } |
| 1182 | |
| 1183 | void uiFocus(const bool focus, CrossingMode) override |
| 1184 | { |
nothing calls this directly
no test coverage detected