@kne/react-pdf-sign 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -189,7 +189,6 @@ const LocationLayer = withLocale(p => {
189
189
  const [signatureImage] = useImage(signature);
190
190
  const groupRef = useRef();
191
191
  const signRef = useRef();
192
- const targetRef = useRef();
193
192
  const transformerRef = useRef();
194
193
  const computedSignLocation = () => {
195
194
  const absolutePosition = signRef.current.absolutePosition();
@@ -201,8 +200,8 @@ const LocationLayer = withLocale(p => {
201
200
  x: Math.round(absolutePosition.x),
202
201
  y: Math.round(absolutePosition.y)
203
202
  },
204
- scaleX: Number(transformerRef.current.attrs.scaleX.toFixed(2)),
205
- scaleY: Number(transformerRef.current.attrs.scaleY.toFixed(2)),
203
+ scaleX: Number(groupRef.current.attrs.scaleX.toFixed(2)),
204
+ scaleY: Number(groupRef.current.attrs.scaleY.toFixed(2)),
206
205
  x: Math.round(groupRef.current.attrs.x),
207
206
  y: Math.round(groupRef.current.attrs.y)
208
207
  });
@@ -237,7 +236,7 @@ const LocationLayer = withLocale(p => {
237
236
  }, []);
238
237
  useEffect(() => {
239
238
  if (isInit) {
240
- transformerRef.current.nodes([targetRef.current]);
239
+ transformerRef.current.nodes([groupRef.current]);
241
240
  }
242
241
  }, [isInit]);
243
242
  if (!(isInit && value)) {
@@ -253,22 +252,21 @@ const LocationLayer = withLocale(p => {
253
252
  draggable: true,
254
253
  ref: groupRef,
255
254
  onDragEnd: computedSignLocation,
256
- children: [/*#__PURE__*/jsx(Group, {
257
- ref: targetRef,
258
- onTransformEnd: computedSignLocation,
259
- children: signatureImage ? /*#__PURE__*/jsx(Image$1, {
260
- width: width,
261
- height: height,
262
- image: signatureImage,
263
- cornerRadius: 8,
264
- ref: signRef
265
- }) : /*#__PURE__*/jsx(Rect, {
266
- width: width,
267
- height: height,
268
- fill: "#f0f0f0",
269
- cornerRadius: 8,
270
- ref: signRef
271
- })
255
+ scaleX: value.scaleX,
256
+ scaleY: value.scaleY,
257
+ onTransformEnd: computedSignLocation,
258
+ children: [signatureImage ? /*#__PURE__*/jsx(Image$1, {
259
+ width: width,
260
+ height: height,
261
+ image: signatureImage,
262
+ cornerRadius: 8,
263
+ ref: signRef
264
+ }) : /*#__PURE__*/jsx(Rect, {
265
+ width: width,
266
+ height: height,
267
+ fill: "#f0f0f0",
268
+ cornerRadius: 8,
269
+ ref: signRef
272
270
  }), /*#__PURE__*/jsx(Text, {
273
271
  text: signatureImage ? '' : placeholder,
274
272
  fontSize: 16,
@@ -280,9 +278,6 @@ const LocationLayer = withLocale(p => {
280
278
  height: height
281
279
  })]
282
280
  }), /*#__PURE__*/jsx(Transformer, {
283
- scaleX: value.scaleX,
284
- scaleY: value.scaleY,
285
- centeredScaling: true,
286
281
  ref: transformerRef,
287
282
  keepRatio: true,
288
283
  flipEnabled: false,