MCPcopy Create free account
hub / github.com/ColmapView/Colmapview.github.io / getModalPositionResetKey

Function getModalPositionResetKey

src/hooks/useModalDrag.ts:85–96  ·  view source on GitHub ↗
({
  isOpen,
  estimatedWidth,
  estimatedHeight,
  initialPosition,
}: UseModalDragOptions)

Source from the content-addressed store, hash-verified

83}
84
85function getModalPositionResetKey({
86 isOpen,
87 estimatedWidth,
88 estimatedHeight,
89 initialPosition,
90}: UseModalDragOptions): string {
91 if (!isOpen) return 'closed';
92 if (initialPosition) {
93 return `cursor:${estimatedWidth}:${estimatedHeight}:${initialPosition.x}:${initialPosition.y}`;
94 }
95 return `center:${estimatedWidth}:${estimatedHeight}`;
96}
97
98export function useModalDrag({ estimatedWidth, estimatedHeight, isOpen, initialPosition }: UseModalDragOptions) {
99 const initialEstimatedPosition = isOpen

Callers 1

useModalDragFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected