fix: fill cell background color when using contain fit mode

This commit is contained in:
ashim-hq
2026-04-19 16:52:29 +08:00
parent efede1ae4a
commit bc73078264
@@ -257,6 +257,7 @@ function CollageCanvas({ template }: { template: CollageTemplate }) {
isDragSource={isDragSource}
gridColumn={cell.gridColumn}
gridRow={cell.gridRow}
backgroundColor={backgroundColor}
/>
);
})}
@@ -288,6 +289,7 @@ function CollageCell({
isDragSource,
gridColumn,
gridRow,
backgroundColor,
}: {
cellIndex: number;
image: CollageImage | null;
@@ -297,6 +299,7 @@ function CollageCell({
isDragSource: boolean;
gridColumn: string;
gridRow: string;
backgroundColor: string;
}) {
const store = useCollageStore();
const cellRef = useRef<HTMLDivElement>(null);
@@ -437,6 +440,7 @@ function CollageCell({
borderRadius: `${cornerRadius}px`,
minHeight: 0,
touchAction: isSelected ? "none" : "auto",
backgroundColor: transform.objectFit === "contain" ? backgroundColor : undefined,
}}
onClick={handleClick}
onDoubleClick={handleDoubleClick}