Skip to content

Commit

Permalink
Website updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ahocevar committed Nov 25, 2023
1 parent c01dd07 commit ceac6f0
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion dist/en/main/apidoc/module-ol_transform.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ <h4 class="name">

<div class="tag-source">
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/transform.js">transform.js</a>,
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/transform.js#L218">line 218</a>
<a href="https://github.com/openlayers/openlayers/blob/main/src/ol/transform.js#L217">line 217</a>
</div>

</div>
Expand Down
2 changes: 1 addition & 1 deletion dist/en/main/examples/common.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/en/main/examples/common.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/en/main/examples/offscreen-canvas.worker.worker.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/en/main/ol/dist/ol.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/en/main/ol/dist/ol.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/en/main/ol/transform.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions dist/en/main/ol/transform.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* @module ol/transform
*/
import {WORKER_OFFSCREEN_CANVAS} from './has.js';
import {assert} from './asserts.js';

/**
Expand Down Expand Up @@ -266,10 +265,9 @@ export function determinant(mat) {
}

/**
* @type {HTMLElement}
* @private
* @type {Array}
*/
let transformStringDiv;
const matrixPrecision = [1e6, 1e6, 1e6, 1e6, 2, 2];

/**
* A rounded string version of the transform. This can be used
Expand All @@ -278,12 +276,14 @@ let transformStringDiv;
* @return {string} The transform as a string.
*/
export function toString(mat) {
const transformString = 'matrix(' + mat.join(', ') + ')';
if (WORKER_OFFSCREEN_CANVAS) {
return transformString;
}
const node =
transformStringDiv || (transformStringDiv = document.createElement('div'));
node.style.transform = transformString;
return node.style.transform;
const transformString =
'matrix(' +
mat
.map(
(value, i) =>
Math.round(value * matrixPrecision[i]) / matrixPrecision[i]
)
.join(', ') +
')';
return transformString;
}

0 comments on commit ceac6f0

Please sign in to comment.