@cloud-app-dev/vidc 3.0.40 → 3.0.42

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.
@@ -31,7 +31,7 @@ function DragMarker(_ref) {
31
31
  var latlng = type.leaflet ? e.target.getLatLng() : e.target.getPosition();
32
32
  instance.setCenter(latlng);
33
33
  onChange === null || onChange === void 0 ? void 0 : onChange({
34
- center: latlng
34
+ center: [latlng.getLng(), latlng.getLat()]
35
35
  });
36
36
  });
37
37
  instance.map.on('moveend', function () {
package/es/ROI/demo.js CHANGED
@@ -4,7 +4,7 @@ import ROI from './index';
4
4
  var App = function App() {
5
5
  return /*#__PURE__*/React.createElement("div", {
6
6
  style: {
7
- width: 600,
7
+ width: "100%",
8
8
  height: 400,
9
9
  background: '#999'
10
10
  }
@@ -29,7 +29,7 @@ function RatePick(_ref) {
29
29
 
30
30
  _useUpdateEffect(function () {
31
31
  return onChange(state.rate);
32
- }, []);
32
+ }, [state.rate]);
33
33
 
34
34
  return /*#__PURE__*/React.createElement(CustomRenderSelect, {
35
35
  value: state.rate,
@@ -1,5 +1,5 @@
1
1
  import _useEventListener from "ahooks/es/useEventListener";
2
- import _useMount from "ahooks/es/useMount";
2
+ import _useSize from "ahooks/es/useSize";
3
3
  import _useLatest from "ahooks/es/useLatest";
4
4
 
5
5
  function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
@@ -47,16 +47,21 @@ function useDrawROI(target, _ref) {
47
47
 
48
48
  var isOpenRef = _useLatest(state.isOpen);
49
49
 
50
- _useMount(function () {
51
- var canvas = getTargetElement(target);
52
-
53
- var _canvas$getBoundingCl = canvas.getBoundingClientRect(),
54
- width = _canvas$getBoundingCl.width,
55
- height = _canvas$getBoundingCl.height;
50
+ var size = _useSize(target);
56
51
 
57
- canvas.width = width;
58
- canvas.height = height;
59
- });
52
+ useEffect(function () {
53
+ var canvas = getTargetElement(target);
54
+ canvas.width = size === null || size === void 0 ? void 0 : size.width;
55
+ canvas.height = size === null || size === void 0 ? void 0 : size.height;
56
+ console.warn('canvas,size变化,请重新绘制!');
57
+ setState(function (old) {
58
+ return Object.assign(Object.assign({}, old), {
59
+ pos: [],
60
+ tempPos: [],
61
+ saveArea: []
62
+ });
63
+ }); // eslint-disable-next-line react-hooks/exhaustive-deps
64
+ }, [size === null || size === void 0 ? void 0 : size.height, size === null || size === void 0 ? void 0 : size.width]);
60
65
 
61
66
  _useEventListener('click', function (event) {
62
67
  if (!isOpenRef.current) {
@@ -275,9 +280,9 @@ function useDrawROI(target, _ref) {
275
280
  return rioArr;
276
281
  }
277
282
 
278
- var _canvas$getBoundingCl2 = canvas.getBoundingClientRect(),
279
- width = _canvas$getBoundingCl2.width,
280
- height = _canvas$getBoundingCl2.height;
283
+ var _canvas$getBoundingCl = canvas.getBoundingClientRect(),
284
+ width = _canvas$getBoundingCl.width,
285
+ height = _canvas$getBoundingCl.height;
281
286
 
282
287
  var itemWidth = width / rowItems;
283
288
  var itemHeight = height / row; // 转换当前绘制完成的区域为多边形
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "private": false,
3
3
  "name": "@cloud-app-dev/vidc",
4
4
  "description": "Video Image Data Componennts",
5
- "version": "3.0.40",
5
+ "version": "3.0.42",
6
6
  "scripts": {
7
7
  "start": "dumi dev",
8
8
  "docs:build": "dumi build",