hyperframes 0.4.41 → 0.4.43

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.
@@ -90,6 +90,7 @@ window.__contrastAudit = async function (imgBase64, time) {
90
90
  if (parseFloat(cs.opacity) <= 0.01) continue;
91
91
  var rect = el.getBoundingClientRect();
92
92
  if (rect.width < 8 || rect.height < 8) continue;
93
+ if (rect.right <= 0 || rect.bottom <= 0 || rect.left >= w || rect.top >= h) continue;
93
94
 
94
95
  var fg = parseColor(cs.color);
95
96
  if (fg[3] <= 0.01) continue;
@@ -103,6 +104,7 @@ window.__contrastAudit = async function (imgBase64, time) {
103
104
  var y0 = Math.max(0, Math.floor(rect.y) - 4);
104
105
  var y1 = Math.min(h - 1, Math.ceil(rect.y + rect.height) + 4);
105
106
  var sample = function (sx, sy) {
107
+ if (sx < 0 || sx >= w || sy < 0 || sy >= h) return;
106
108
  var idx = (sy * w + sx) * 4;
107
109
  rr.push(px[idx]);
108
110
  gg.push(px[idx + 1]);