feat: add background color picker and update related functionality in DesignerToolbar

This commit is contained in:
Frank John Begornia
2025-11-18 01:37:09 +08:00
parent 8a9703c24a
commit fce7a0ec72
3 changed files with 44 additions and 0 deletions

View File

@@ -753,6 +753,20 @@ export const useSlipmatDesigner = () => {
);
};
const setBackgroundColor = (color: string) => {
const bgCircle = backgroundCircle.value;
if (!bgCircle || !canvas.value) {
return;
}
bgCircle.set({ fill: color });
selectedTemplate.value = {
...selectedTemplate.value,
backgroundColor: color,
};
canvas.value.requestRenderAll();
schedulePreviewRefresh();
};
watch(selectedTemplate, () => {
resetZoom();
applyTemplateToCanvas();
@@ -788,6 +802,7 @@ export const useSlipmatDesigner = () => {
addImageFromFile,
setActiveFillColor,
setActiveStrokeColor,
setBackgroundColor,
setZoom,
zoomIn,
zoomOut,