Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
<title>Canvas test: {{ name }}</title>
<link rel="stylesheet" href="/html/canvas/resources/canvas-grid-reftest.css">
<h1>{{ name }}</h1>
<p>{{ desc }}</p>
{% if notes %}<p>{{ notes }}</p>{% endif %}
<div class="grid-container" style="--grid-width: {{ grid_width }}">
{% for variant in variants %}
<span>
{% for variant_name in variant.grid_variant_names %}
<div>{{ variant_name }}</div>
{% endfor %}
{% set x_pos = ((loop.index0 % grid_width) | int) * variant.size[0] %}
{% set y_pos = ((loop.index0 / grid_width) | int) * variant.size[1] %}
<img src="{{ img_reference }}"
class="grid-cell-content"
style="width: {{ variant.size[0] }}px;
height: {{ variant.size[1] }}px;
object-position: {{ -x_pos }}px {{ -y_pos }}px;
object-fit: none;">
</span>
{% endfor %}
</div>