seperate adjust
This commit is contained in:
@@ -9,16 +9,18 @@ export interface ImageItem {
|
||||
width?: number;
|
||||
height?: number;
|
||||
zcaSuggestion?: { x: number; y: number; zone: string };
|
||||
manualPosition?: { x: number; y: number };
|
||||
}
|
||||
|
||||
export interface WatermarkSettings {
|
||||
type: 'text'; // Fixed to text
|
||||
type: 'text';
|
||||
text: string;
|
||||
color: string; // Hex
|
||||
opacity: number; // 0-1
|
||||
scale: number; // 0.01 - 0.5 (relative to image height)
|
||||
manual_override: boolean;
|
||||
manual_position: { x: number, y: number };
|
||||
color: string;
|
||||
opacity: number;
|
||||
scale: number;
|
||||
// Global override removed/deprecated in logic, but kept in type if needed for other things?
|
||||
// Let's keep it clean: no global override flag anymore for logic.
|
||||
// But backend struct expects it. We can just ignore it or send dummy.
|
||||
}
|
||||
|
||||
export const useGalleryStore = defineStore("gallery", () => {
|
||||
@@ -28,10 +30,8 @@ export const useGalleryStore = defineStore("gallery", () => {
|
||||
type: 'text',
|
||||
text: 'Watermark',
|
||||
color: '#FFFFFF',
|
||||
opacity: 0.8,
|
||||
scale: 0.03, // 3% of height default
|
||||
manual_override: false,
|
||||
manual_position: { x: 0.5, y: 0.97 } // 3% from bottom
|
||||
opacity: 1.0,
|
||||
scale: 0.03,
|
||||
});
|
||||
|
||||
const selectedImage = computed(() => {
|
||||
@@ -50,6 +50,12 @@ export const useGalleryStore = defineStore("gallery", () => {
|
||||
watermarkSettings.value = { ...watermarkSettings.value, ...settings };
|
||||
}
|
||||
|
||||
function setImageManualPosition(index: number, x: number, y: number) {
|
||||
if (images.value[index]) {
|
||||
images.value[index].manualPosition = { x, y };
|
||||
}
|
||||
}
|
||||
|
||||
async function selectImage(index: number) {
|
||||
if (index < 0 || index >= images.value.length) return;
|
||||
selectedIndex.value = index;
|
||||
@@ -72,6 +78,7 @@ export const useGalleryStore = defineStore("gallery", () => {
|
||||
watermarkSettings,
|
||||
setImages,
|
||||
selectImage,
|
||||
updateWatermarkSettings
|
||||
updateWatermarkSettings,
|
||||
setImageManualPosition
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user