mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: fill cell background color when using contain fit mode
This commit is contained in:
@@ -257,6 +257,7 @@ function CollageCanvas({ template }: { template: CollageTemplate }) {
|
|||||||
isDragSource={isDragSource}
|
isDragSource={isDragSource}
|
||||||
gridColumn={cell.gridColumn}
|
gridColumn={cell.gridColumn}
|
||||||
gridRow={cell.gridRow}
|
gridRow={cell.gridRow}
|
||||||
|
backgroundColor={backgroundColor}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
@@ -288,6 +289,7 @@ function CollageCell({
|
|||||||
isDragSource,
|
isDragSource,
|
||||||
gridColumn,
|
gridColumn,
|
||||||
gridRow,
|
gridRow,
|
||||||
|
backgroundColor,
|
||||||
}: {
|
}: {
|
||||||
cellIndex: number;
|
cellIndex: number;
|
||||||
image: CollageImage | null;
|
image: CollageImage | null;
|
||||||
@@ -297,6 +299,7 @@ function CollageCell({
|
|||||||
isDragSource: boolean;
|
isDragSource: boolean;
|
||||||
gridColumn: string;
|
gridColumn: string;
|
||||||
gridRow: string;
|
gridRow: string;
|
||||||
|
backgroundColor: string;
|
||||||
}) {
|
}) {
|
||||||
const store = useCollageStore();
|
const store = useCollageStore();
|
||||||
const cellRef = useRef<HTMLDivElement>(null);
|
const cellRef = useRef<HTMLDivElement>(null);
|
||||||
@@ -437,6 +440,7 @@ function CollageCell({
|
|||||||
borderRadius: `${cornerRadius}px`,
|
borderRadius: `${cornerRadius}px`,
|
||||||
minHeight: 0,
|
minHeight: 0,
|
||||||
touchAction: isSelected ? "none" : "auto",
|
touchAction: isSelected ? "none" : "auto",
|
||||||
|
backgroundColor: transform.objectFit === "contain" ? backgroundColor : undefined,
|
||||||
}}
|
}}
|
||||||
onClick={handleClick}
|
onClick={handleClick}
|
||||||
onDoubleClick={handleDoubleClick}
|
onDoubleClick={handleDoubleClick}
|
||||||
|
|||||||
Reference in New Issue
Block a user