Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/layout/reftests/canvas/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  ctm-singular-sanity.html   Sprache: HTML

 
 products/Sources/formale Sprachen/C/Firefox/layout/reftests/canvas/ctm-singular-sanity.html


<html>
<head>
  <script type="text/javascript">
function assert(cond, msg) {
  if (!cond) {
    throw msg;
  }
}

assert.equal = function(m1, m2, msg) {
  assert(
    m1.is2D &&
      m2.is2D &&
      m1.a === m2.a &&
      m1.b === m2.b &&
      m1.c === m2.c &&
      m1.d === m2.d &&
      m1.e === m2.e &&
      m1.f === m2.f,
    msg
  );
};

window.onload = function() {
  try {
    var ctx = document.getElementById("c1").getContext("2d");

    var singular = new DOMMatrix([0, 0, 0, 0, 0, 0]);
    ctx.setTransform(singular);
    assert.equal(
      ctx.getTransform(),
      singular,
      "Expected setting transform to a singular matrix to work"
    );
    var inv = ctx.getTransform().invertSelf();
    assert(
      isNaN(inv.a) && isNaN(inv.b) && isNaN(inv.c) && isNaN(inv.d),
      "Expected to get back matrix of NaN's from inverse transform"
    );

    var m = new DOMMatrix([1, 2, 3, 4, 5, 6]);
    ctx.setTransform(m);
    ctx.setTransform(singular.invertSelf());
    assert.equal(
      ctx.getTransform(),
      m,
      "Setting transform to an inverse singular matrix is a no-op"
    );
  } catch (e) {
    document.body.innerHTML = "FAIL: " + e.toString();
    return;
  }
  document.body.innerHTML = "Pass";
};
  </script>
</head>
<body>
  <div><canvas id="c1" width="300" height="300"></canvas></div>
</body>
</html>

Messung V0.5
C=95 H=97 G=95

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.