MCPcopy Index your code
hub / github.com/OpenSignLabs/OpenSign / createCustomPositionWidget

Function createCustomPositionWidget

apps/OpenSign/src/utils/widgetUtils.js:114–146  ·  view source on GitHub ↗
({
  customPosition,
  key,
  containerScale,
  posZIndex,
  dragTypeValue,
  pageNumber,
  owner,
  signerPlaceHolder,
  roleName
})

Source from the content-addressed store, hash-verified

112// via click-and-drag drawing (i.e. when customOptions.customPosition is provided).
113// Returns { dropObj, placeHolder } where placeHolder.pos === [dropObj].
114export const createCustomPositionWidget = ({
115 customPosition,
116 key,
117 containerScale,
118 posZIndex,
119 dragTypeValue,
120 pageNumber,
121 owner,
122 signerPlaceHolder,
123 roleName
124}) => {
125 const { xPosition, yPosition, width, height } = customPosition;
126 const dropObj = {
127 xPosition,
128 yPosition,
129 isStamp: false,
130 key,
131 scale: containerScale,
132 zIndex: posZIndex,
133 type: dragTypeValue,
134 options: addWidgetOptions(
135 dragTypeValue,
136 owner,
137 signerPlaceHolder,
138 roleName
139 ),
140 Width: width,
141 Height: height
142 };
143 const dropData = [dropObj];
144 const placeHolder = { pageNumber, pos: dropData };
145 return { dropObj, placeHolder };
146};
147
148/**
149 *

Callers

nothing calls this directly

Calls 1

addWidgetOptionsFunction · 0.90

Tested by

no test coverage detected