import './MeshTransformButton.scss'; import * as React from 'react'; import ReactLoading from 'react-loading'; import { Button, IconButton, Type } from '@dash/components'; import { AiOutlineInfo } from 'react-icons/ai'; import { SettingsManager } from '../../../../util/SettingsManager'; import MeshTransformGrid from './imageMesh'; interface ButtonContainerProps { onClick: () => Promise; loading: boolean; onReset: () => void; btnText: string; imageWidth: number; imageHeight: number; gridXSize: number; // X subdivisions gridYSize: number; // Y subdivisions } export function MeshTransformButton({ loading, onClick, onReset, btnText, imageWidth, imageHeight, gridXSize, gridYSize }: ButtonContainerProps) { const [showGrid, setShowGrid] = React.useState(false); const [isGridInteractive, setIsGridInteractive] = React.useState(false); // Controls the dragging of control points const imageRef = React.useRef(null); // Reference to the image element const handleGridToggle = () => { if (showGrid) { setShowGrid(false); // Hide the grid setIsGridInteractive(false); // Disable control points manipulation } else { setShowGrid(true); // Show the grid setIsGridInteractive(true); // Enable control points manipulation } }; return (
); }