Browse Source

Fix LEDBezelLight size.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
9423354b98
2 changed files with 7 additions and 13 deletions
  1. +2
    -11
      include/componentlibrary.hpp
  2. +5
    -2
      include/helpers.hpp

+ 2
- 11
include/componentlibrary.hpp View File

@@ -215,8 +215,9 @@ struct RectangleLight : Base {
template <typename Base>
struct LEDBezelLight : Base {
LEDBezelLight() {
this->borderColor = color::BLACK_TRANSPARENT;
this->bgColor = color::BLACK_TRANSPARENT;
this->box.size = mm2px(math::Vec(6.0, 6.0));
this->box.size = math::Vec(17.545, 17.545);
}
};

@@ -687,11 +688,6 @@ struct LightSlider : Base {
this->addChild(light);
}

void setFirstLightId(int firstLightId) {
light->module = this->module;
light->firstLightId = firstLightId;
}

void step() override {
Base::step();
// Move center of light to center of handle
@@ -838,11 +834,6 @@ struct LEDLightBezel : LEDBezel {
light->box.pos = box.size.div(2).minus(light->box.size.div(2));
addChild(light);
}

void setFirstLightId(int firstLightId) {
light->module = this->module;
light->firstLightId = firstLightId;
}
};

struct PB61303 : app::SvgSwitch {


+ 5
- 2
include/helpers.hpp View File

@@ -144,11 +144,14 @@ TModuleLightWidget* createLightCentered(math::Vec pos, engine::Module* module, i
}


/** Creates a param with a light and calls setFirstLightId() on it. */
/** Creates a param with a light and calls setFirstLightId() on it.
Requires ParamWidget to have a `light` member.
*/
template <class TParamWidget>
TParamWidget* createLightParam(math::Vec pos, engine::Module* module, int paramId, int firstLightId) {
TParamWidget* o = createParam<TParamWidget>(pos, module, paramId);
o->setFirstLightId(firstLightId);
o->light->module = module;
o->light->firstLightId = firstLightId;
return o;
}



Loading…
Cancel
Save