修补自定义分段后,面板过长的问题

This commit is contained in:
JIANG
2025-11-18 14:32:21 +08:00
parent 9c533c0911
commit a85ded8a39

View File

@@ -715,7 +715,7 @@ const StyleEditorPanel: React.FC<StyleEditorPanelProps> = ({
// 判断此次触发是否由用户点击“应用”按钮引起 // 判断此次触发是否由用户点击“应用”按钮引起
const isUserTrigger = const isUserTrigger =
styleUpdateTrigger !== prevStyleUpdateTriggerRef.current; styleUpdateTrigger !== prevStyleUpdateTriggerRef.current;
// 更新 prevStyleUpdateTriggerRef // 更新 prevStyleUpdateTrigger
prevStyleUpdateTriggerRef.current = styleUpdateTrigger; prevStyleUpdateTriggerRef.current = styleUpdateTrigger;
const updateJunctionStyle = () => { const updateJunctionStyle = () => {
@@ -1368,8 +1368,12 @@ const StyleEditorPanel: React.FC<StyleEditorPanelProps> = ({
<Typography variant="subtitle2" gutterBottom> <Typography variant="subtitle2" gutterBottom>
{">="} 0 {">="} 0
</Typography> </Typography>
<Box className="flex flex-col gap-2"> <Box
{Array.from({ length: styleConfig.segments }).map((_, idx) => ( className="flex flex-col gap-2"
sx={{ maxHeight: "240px", overflowY: "auto", paddingTop: "12px" }}
>
{Array.from({ length: styleConfig.segments + 1 }).map(
(_, idx) => (
<TextField <TextField
key={idx} key={idx}
label={`阈值 ${idx + 1}`} label={`阈值 ${idx + 1}`}
@@ -1406,7 +1410,8 @@ const StyleEditorPanel: React.FC<StyleEditorPanelProps> = ({
}); });
}} }}
/> />
))} )
)}
</Box> </Box>
</Box> </Box>
)} )}