Make it possible to start selections from below the dope sheet's rows
This commit is contained in:
parent
c0fd71e4f9
commit
e0359cb4b0
2 changed files with 10 additions and 3 deletions
|
@ -33,7 +33,8 @@ const Container = styled.div<{isShiftDown: boolean}>`
|
||||||
|
|
||||||
const DopeSheetSelectionView: React.FC<{
|
const DopeSheetSelectionView: React.FC<{
|
||||||
layoutP: Pointer<SequenceEditorPanelLayout>
|
layoutP: Pointer<SequenceEditorPanelLayout>
|
||||||
}> = ({layoutP, children}) => {
|
height: number
|
||||||
|
}> = ({layoutP, children, height}) => {
|
||||||
const [containerRef, containerNode] = useRefAndState<HTMLDivElement | null>(
|
const [containerRef, containerNode] = useRefAndState<HTMLDivElement | null>(
|
||||||
null,
|
null,
|
||||||
)
|
)
|
||||||
|
@ -43,7 +44,12 @@ const DopeSheetSelectionView: React.FC<{
|
||||||
selectionBoundsRef.current = selectionBounds
|
selectionBoundsRef.current = selectionBounds
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container ref={containerRef} isShiftDown={isShiftDown}>
|
<Container
|
||||||
|
style={{height: height + 'px'}}
|
||||||
|
ref={containerRef}
|
||||||
|
isShiftDown={isShiftDown}
|
||||||
|
className="selectionview"
|
||||||
|
>
|
||||||
{selectionBounds && (
|
{selectionBounds && (
|
||||||
<SelectionRectangle state={selectionBounds} layoutP={layoutP} />
|
<SelectionRectangle state={selectionBounds} layoutP={layoutP} />
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -40,6 +40,7 @@ const Right: React.FC<{
|
||||||
const tree = val(layoutP.tree)
|
const tree = val(layoutP.tree)
|
||||||
const height =
|
const height =
|
||||||
val(layoutP.tree.top) +
|
val(layoutP.tree.top) +
|
||||||
|
// stretch the height of the dope sheet in case the rows don't cover its whole vertical space
|
||||||
Math.max(
|
Math.max(
|
||||||
val(layoutP.tree.heightIncludingChildren),
|
val(layoutP.tree.heightIncludingChildren),
|
||||||
val(layoutP.dopeSheetDims.height),
|
val(layoutP.dopeSheetDims.height),
|
||||||
|
@ -48,7 +49,7 @@ const Right: React.FC<{
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<HorizontallyScrollableArea layoutP={layoutP} height={height}>
|
<HorizontallyScrollableArea layoutP={layoutP} height={height}>
|
||||||
<DopeSheetSelectionView layoutP={layoutP}>
|
<DopeSheetSelectionView layoutP={layoutP} height={height}>
|
||||||
<ListContainer style={{top: tree.top + 'px'}}>
|
<ListContainer style={{top: tree.top + 'px'}}>
|
||||||
<SheetRow leaf={tree} layoutP={layoutP} />
|
<SheetRow leaf={tree} layoutP={layoutP} />
|
||||||
</ListContainer>
|
</ListContainer>
|
||||||
|
|
Loading…
Reference in a new issue