diff --git a/src/components/browser/BrowserWindow.tsx b/src/components/browser/BrowserWindow.tsx index dbd43f61..4076c680 100644 --- a/src/components/browser/BrowserWindow.tsx +++ b/src/components/browser/BrowserWindow.tsx @@ -77,7 +77,7 @@ export const BrowserWindow = () => { const [attributeOptions, setAttributeOptions] = useState([]); const [selectedElement, setSelectedElement] = useState<{ selector: string, info: ElementInfo | null } | null>(null); const [currentListId, setCurrentListId] = useState(null); - const [viewportInfo, setViewportInfo] = useState({ width: VIEWPORT_W, height: VIEWPORT_H }); + const [viewportInfo, setViewportInfo] = useState({ width: window.innerWidth * 0.75, height: window.innerHeight * 0.64 }); const [listSelector, setListSelector] = useState(null); const [fields, setFields] = useState>({}); @@ -92,7 +92,7 @@ export const BrowserWindow = () => { const { user } = state; useEffect(() => { - coordinateMapper.updateDimensions(VIEWPORT_W, VIEWPORT_H, viewportInfo.width, viewportInfo.height); + coordinateMapper.updateDimensions(window.innerWidth * 0.75, window.innerHeight * 0.64, viewportInfo.width, viewportInfo.height); }, [viewportInfo]); useEffect(() => { @@ -480,7 +480,7 @@ export const BrowserWindow = () => { }, [paginationMode, resetPaginationSelector]); return ( -
+
{ getText === true || getList === true ? ( { ) : null } -
+
{((getText === true || getList === true) && !showAttributeModal && highlighterData?.rect != null && highlighterData?.rect.top != null) && canvasRef?.current ? : null} -
- Browser viewport: {viewportInfo.width}x{viewportInfo.height} -
); @@ -558,7 +555,7 @@ const drawImage = (image: string, canvas: HTMLCanvasElement): void => { img.src = image; img.onload = () => { URL.revokeObjectURL(img.src); - ctx?.drawImage(img, 0, 0, 900, 400); + ctx?.drawImage(img, 0, 0, window.innerWidth * 0.75, window.innerHeight * 0.64); }; };