- minor improvements to painter
This commit is contained in:
@@ -13,14 +13,14 @@ const gap = 0;
|
||||
type VideoFeedGridPainterProps = {
|
||||
regions: Region[];
|
||||
selectedRegionIndex: number;
|
||||
isErasing: boolean;
|
||||
mode: string;
|
||||
};
|
||||
|
||||
type PaintedCell = {
|
||||
colour: string;
|
||||
};
|
||||
|
||||
const VideoFeedGridPainter = ({ regions, selectedRegionIndex, isErasing }: VideoFeedGridPainterProps) => {
|
||||
const VideoFeedGridPainter = ({ regions, selectedRegionIndex, mode }: VideoFeedGridPainterProps) => {
|
||||
const { latestBitmapRef, isloading } = useCreateVideoSnapshot();
|
||||
const [stageSize, setStageSize] = useState({ width: 740, height: 460 });
|
||||
const isDrawingRef = useRef(false);
|
||||
@@ -53,7 +53,7 @@ const VideoFeedGridPainter = ({ regions, selectedRegionIndex, isErasing }: Video
|
||||
const map = paintedCellsRef.current;
|
||||
const existing = map.get(key);
|
||||
|
||||
if (isErasing) {
|
||||
if (mode === "eraser") {
|
||||
if (map.has(key)) {
|
||||
map.delete(key);
|
||||
paintLayerRef.current?.batchDraw();
|
||||
|
||||
Reference in New Issue
Block a user