MCPcopy Create free account
hub / github.com/Snapchat/Valdi / setBoxShadow

Method setBoxShadow

snap_drawing/src/snap_drawing/cpp/Layers/Layer.cpp:934–948  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

932}
933
934void Layer::setBoxShadow(Scalar widthOffset, Scalar heightOffset, Scalar blurAmount, Color color) {
935 if (color == Color::transparent()) {
936 if (_boxShadow != nullptr) {
937 _boxShadow = nullptr;
938 setNeedsDisplay();
939 }
940 } else {
941 if (_boxShadow == nullptr) {
942 _boxShadow = Valdi::makeShared<BoxShadow>();
943 }
944 _boxShadow->setOffset(Size::make(widthOffset, heightOffset));
945 _boxShadow->setBlurAmount(blurAmount);
946 _boxShadow->setColor(color);
947 }
948}
949
950Scalar Layer::getTranslationX() const {
951 return _translation.width;

Callers

nothing calls this directly

Calls 3

setOffsetMethod · 0.80
setBlurAmountMethod · 0.80
setColorMethod · 0.45

Tested by

no test coverage detected