File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,10 @@ const Designer: React.FC<ISTKProps> = (props) => {
1515 return (
1616 < >
1717 < div
18- className = { twMerge ( "bg-white h-full min-h-[85vh] flex flex-col" , props . styles ?. root ?. className ) }
18+ className = { twMerge (
19+ "bg-white h-full min-h-[85vh] flex flex-col overflow-x-hidden" ,
20+ props . styles ?. root ?. className
21+ ) }
1922 style = { props ?. styles ?. root ?. properties }
2023 >
2124 < Operations { ...props } />
Original file line number Diff line number Diff line change @@ -9,8 +9,9 @@ const useSelection = () => {
99 useLayoutEffect ( ( ) => {
1010 const svg = d3Extended . selectById ( ids . workspace ) ;
1111 if ( svg . node ( ) ) {
12- const toolbarWidth = document . getElementById ( ids . toolbar ) ?. clientWidth ?? 0 ;
13- const operationBarHeight = document . getElementById ( ids . operationBar ) ?. clientHeight ?? 0 ;
12+ const { top : workspaceTop , left : workspaceLeft } = d3Extended . selectionBounds (
13+ d3Extended . selectById ( ids . workspace )
14+ ) ;
1415 const selectionRect = {
1516 element : null ,
1617 currentY : 0 ,
@@ -59,8 +60,8 @@ const useSelection = () => {
5960 this . update ( newX , newY ) ;
6061 } ,
6162 update : function ( newX : number , newY : number ) {
62- this . currentX = newX - ( + this . element ?. attr ( "width" ) > 2 ? toolbarWidth : 0 ) ;
63- this . currentY = newY - ( + this . element ?. attr ( "height" ) > 2 ? operationBarHeight : 0 ) ;
63+ this . currentX = newX - ( + this . element ?. attr ( "width" ) > 2 ? workspaceLeft : 0 ) ;
64+ this . currentY = newY - ( + this . element ?. attr ( "height" ) > 2 ? workspaceTop : 0 ) ;
6465 const attributes = this . getNewAttributes ( ) ;
6566 Object . keys ( attributes ) . forEach ( ( key ) => {
6667 this . element . attr ( key , attributes [ key ] ) ;
You can’t perform that action at this time.
0 commit comments