fix lasertool offset
This commit is contained in:
parent
a249f332a2
commit
c65d6506f7
@ -1217,7 +1217,10 @@ class App extends React.Component<AppProps, AppState> {
|
|||||||
<div className="excalidraw-textEditorContainer" />
|
<div className="excalidraw-textEditorContainer" />
|
||||||
<div className="excalidraw-contextMenuContainer" />
|
<div className="excalidraw-contextMenuContainer" />
|
||||||
<div className="excalidraw-eye-dropper-container" />
|
<div className="excalidraw-eye-dropper-container" />
|
||||||
<LaserToolOverlay manager={this.laserPathManager} />
|
<LaserToolOverlay
|
||||||
|
manager={this.laserPathManager}
|
||||||
|
appState={this.state}
|
||||||
|
/>
|
||||||
{selectedElements.length === 1 &&
|
{selectedElements.length === 1 &&
|
||||||
!this.state.contextMenu &&
|
!this.state.contextMenu &&
|
||||||
this.state.showHyperlinkPopup && (
|
this.state.showHyperlinkPopup && (
|
||||||
|
@ -1,12 +1,17 @@
|
|||||||
import { useEffect, useRef } from "react";
|
import { useEffect, useRef } from "react";
|
||||||
import { LaserPathManager } from "./LaserPathManager";
|
import { LaserPathManager } from "./LaserPathManager";
|
||||||
import "./LaserToolOverlay.scss";
|
import "./LaserToolOverlay.scss";
|
||||||
|
import { UIAppState } from "../../types";
|
||||||
|
|
||||||
type LaserToolOverlayProps = {
|
type LaserToolOverlayProps = {
|
||||||
manager: LaserPathManager;
|
manager: LaserPathManager;
|
||||||
|
appState: UIAppState;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const LaserToolOverlay = ({ manager }: LaserToolOverlayProps) => {
|
export const LaserToolOverlay = ({
|
||||||
|
manager,
|
||||||
|
appState,
|
||||||
|
}: LaserToolOverlayProps) => {
|
||||||
const svgRef = useRef<SVGSVGElement | null>(null);
|
const svgRef = useRef<SVGSVGElement | null>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -20,7 +25,13 @@ export const LaserToolOverlay = ({ manager }: LaserToolOverlayProps) => {
|
|||||||
}, [manager]);
|
}, [manager]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="LaserToolOverlay">
|
<div
|
||||||
|
className="LaserToolOverlay"
|
||||||
|
style={{
|
||||||
|
top: `-${appState.offsetTop}px`,
|
||||||
|
left: `-${appState.offsetLeft}px`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
<svg ref={svgRef} className="LaserToolOverlayCanvas" />
|
<svg ref={svgRef} className="LaserToolOverlayCanvas" />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -4,9 +4,6 @@
|
|||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
|
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
|
||||||
.LaserToolOverlayCanvas {
|
.LaserToolOverlayCanvas {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user