Loads of button generator additions
This commit is contained in:
parent
98b4edf47d
commit
e7754141bf
12 changed files with 904 additions and 126 deletions
|
|
@ -245,12 +245,17 @@ export class ExternalImageBackgroundEffect extends ButtonEffect {
|
|||
|
||||
apply(context, controlValues, animState, renderData) {
|
||||
const file = controlValues['bg-image-file'];
|
||||
const bgColor = controlValues['bg-color'] || '#FFFFFF';
|
||||
const fitMode = controlValues['bg-image-fit'] || 'cover';
|
||||
const opacity = controlValues['bg-image-opacity'] ?? 1;
|
||||
const zoom = controlValues['bg-image-zoom'] ?? 100;
|
||||
const offsetX = controlValues['bg-image-offset-x'] ?? 50;
|
||||
const offsetY = controlValues['bg-image-offset-y'] ?? 50;
|
||||
|
||||
// Draw background color first (always, for all states)
|
||||
context.fillStyle = bgColor;
|
||||
context.fillRect(0, 0, renderData.width, renderData.height);
|
||||
|
||||
// If no file selected, fill with a placeholder color
|
||||
if (!file || !file.blobUrl) {
|
||||
context.fillStyle = '#cccccc';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue