@oliasoft-open-source/charts-library 4.3.2-beta-1 → 4.3.2

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.
package/dist/index.js CHANGED
@@ -26118,7 +26118,7 @@ const handleAnnotationMouseDown = (event, canvas2, scales, annotations, setDragg
26118
26118
  if (!annotation2)
26119
26119
  return;
26120
26120
  const metrics = calculateAnnotationMetricsInValues(annotation2);
26121
- if (annotation2 && annotation2.enableDrag && metrics.centerY && metrics.centerX) {
26121
+ if (annotation2 && annotation2.enableDrag && !isNil(metrics.centerY) && !isNil(metrics.centerX)) {
26122
26122
  canvas2.style.cursor = CursorStyle.Move;
26123
26123
  const dragStartX = x2 - metrics.centerX;
26124
26124
  const dragStartY = y2 - metrics.centerY;
@@ -26141,7 +26141,7 @@ const handleAnnotationMouseMove = (event, canvas2, scales, isDragging2, activeAn
26141
26141
  activeAnnotation.xValue = newCenterX;
26142
26142
  activeAnnotation.yValue = newCenterY;
26143
26143
  } else if ((activeAnnotation == null ? void 0 : activeAnnotation.type) === AnnotationType.BOX) {
26144
- if ((metrics == null ? void 0 : metrics.width) && metrics.height) {
26144
+ if (!isNil(metrics == null ? void 0 : metrics.width) && !isNil(metrics.height)) {
26145
26145
  activeAnnotation.xMin = newCenterX - metrics.width / 2;
26146
26146
  activeAnnotation.xMax = newCenterX + metrics.width / 2;
26147
26147
  activeAnnotation.yMin = newCenterY - metrics.height / 2;
@@ -26155,7 +26155,7 @@ const handleAnnotationMouseMove = (event, canvas2, scales, isDragging2, activeAn
26155
26155
  const { ctx, width, height } = chart2;
26156
26156
  const { centerX, centerY } = calculateAnnotationMetricsInValues(activeAnnotation) ?? {};
26157
26157
  const { centerX: xValue, centerY: yValue } = calculateAnnotationMetricsInValuesInPixels(activeAnnotation, scales);
26158
- if (centerX && centerY && xValue && yValue) {
26158
+ if (!isNil(centerX) && !isNil(centerY) && !isNil(xValue) && !isNil(yValue)) {
26159
26159
  ctx.save();
26160
26160
  ctx.clearRect(0, 0, width, height);
26161
26161
  chart2.draw();