Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for LEDs without backing SVG #240

Open
danngreen opened this issue Apr 15, 2024 · 0 comments
Open

Support for LEDs without backing SVG #240

danngreen opened this issue Apr 15, 2024 · 0 comments

Comments

@danngreen
Copy link
Member

See make_element.cc:

std::string_view get_led_image_by_size(rack::widget::Widget const *widget) {
auto size = to_mm(widget->box.size.x);
std::string_view image = size <= 2.6f ? "rack-lib/SmallLight.png" : //4px => 2.14mm
size <= 3.7f ? "rack-lib/MediumLight.png" : //6px => 3.21mm
size <= 4.5f ? "rack-lib/Light8px.png" : //8px => 4.28mm
size <= 5.3f ? "rack-lib/LargeLight.png" : //9px => 4.82mm
size <= 6.5f ? "rack-lib/VCVBezelLight.png" : //11px => 5.89mm
size <= 18.f ? "rack-lib/VCVBezel.png" : //14px => 7.5mm
"rack-lib/Rogan6PSLight.png"; //44px
return image;
}

The widget box size is used to find a SVG that's a similar size since as it is now, MetaModule::LightElement needs an image.
Instead we could have a MetaModule::LightElement have a diameter field which is used to draw and redraw the light. If the image field is present, then that's used. If not, then the diameter field is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants