@litigiovirtual/ius-design-components 2.15.3 → 2.15.4

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.
@@ -28469,7 +28469,13 @@ class ImageCropperComponent {
28469
28469
  }
28470
28470
  ctx.imageSmoothingEnabled = true;
28471
28471
  ctx.imageSmoothingQuality = 'high';
28472
- ctx.drawImage(im, crop.x, crop.y, crop.width, crop.height, 0, 0, ow, oh);
28472
+ // La imagen completa, escalada y desplazada para que el recorte cubra el lienzo (lo de fuera se descarta).
28473
+ // No se usa el rectángulo de origen de drawImage: con un SVG sin width/height (solo viewBox, lo común en
28474
+ // logotipos) el navegador reporta un tamaño natural por defecto (150×150 en Chrome) que no es el que usa al
28475
+ // recortar por origen, y la salida era la esquina superior izquierda ampliada. Dibujar solo con destino
28476
+ // respeta el viewBox, da el mismo resultado con PNG y JPG, y el SVG sale nítido a cualquier outputSize.
28477
+ const escala = ow / crop.width;
28478
+ ctx.drawImage(im, -crop.x * escala, -crop.y * escala, n.w * escala, n.h * escala);
28473
28479
  const zoom = this.zoom();
28474
28480
  this.applying.set(true);
28475
28481
  try {