forked from plugdata-team/plugdata
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStackShadow.cpp
More file actions
23 lines (19 loc) · 720 Bytes
/
StackShadow.cpp
File metadata and controls
23 lines (19 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "StackShadow.h"
#include <melatonin_blur/melatonin_blur.h>
StackShadow::StackShadow() = default;
StackShadow::~StackShadow()
{
clearSingletonInstance();
}
void StackShadow::renderDropShadow(hash32 const id, juce::Graphics& g, juce::Path const& path, juce::Colour color, int const radius, juce::Point<int> const offset, int const spread)
{
auto& dropShadow = StackShadow::getInstance()->dropShadows[id];
if (!dropShadow)
dropShadow = std::make_unique<melatonin::DropShadow>();
dropShadow->setColor(color);
dropShadow->setOffset(offset);
dropShadow->setRadius(radius);
dropShadow->setSpread(spread);
dropShadow->render(g, path);
}
JUCE_IMPLEMENT_SINGLETON(StackShadow)