B: Fix contextMenu overflow
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run

This commit is contained in:
Ivan 2024-09-01 13:52:32 +03:00
parent c44495a8b1
commit 02e8d24d2b
2 changed files with 7 additions and 2 deletions

View File

@ -101,8 +101,12 @@ function NodeContextMenu({
};
return (
<div ref={ref} className='absolute select-none' style={{ top: cursorY, left: cursorX, width: 10, height: 10 }}>
<Dropdown isOpen={isOpen} stretchLeft={cursorX >= window.innerWidth - PARAMETER.ossContextMenuWidth}>
<div ref={ref} className='absolute select-none' style={{ top: cursorY, left: cursorX }}>
<Dropdown
isOpen={isOpen}
stretchLeft={cursorX >= window.innerWidth - PARAMETER.ossContextMenuWidth}
stretchTop={cursorY >= window.innerHeight - PARAMETER.ossContextMenuHeight}
>
<DropdownButton
text='Редактировать'
title='Редактировать операцию'

View File

@ -15,6 +15,7 @@ export const PARAMETER = {
ossImageWidth: 1280, // pixels - size of OSS image
ossImageHeight: 960, // pixels - size of OSS image
ossContextMenuWidth: 200, // pixels - width of OSS context menu
ossContextMenuHeight: 200, // pixels - height of OSS context menu
ossGridSize: 10, // pixels - size of OSS grid
ossMinDistance: 20, // pixels - minimum distance between node centers
ossDistanceX: 180, // pixels - insert x-distance between node centers