/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// The minimum distance a line should be before it has an arrow marker-end const ARROW_LINE_MIN_DISTANCE = 10;
var MARKER_COUNTER = 1;
/** * The CssTransformHighlighter is the class that draws an outline around a * transformed element and an outline around where it would be if untransformed * as well as arrows connecting the 2 outlines' corners.
*/ class CssTransformHighlighter extends AutoRefreshHighlighter {
constructor(highlighterEnv) {
super(highlighterEnv);
// The root wrapper is used to unzoom the highlighter when needed. const rootWrapper = this.markup.createNode({
parent: container,
attributes: {
id: "root", class: "root",
},
prefix: this.ID_CLASS_PREFIX,
});
/** * Update the highlighter on the current highlighted node (the one that was * passed as an argument to show(node)). * Should be called whenever node size or attributes change
*/
_update() {
setIgnoreLayoutChanges(true);
// Getting the points for the transformed shape const quads = this.currentQuads.border; if (
!quads.length ||
quads[0].bounds.width <= 0 ||
quads[0].bounds.height <= 0
) { this._hideShapes(); returnfalse;
}
const [quad] = quads;
// Getting the points for the untransformed shape const untransformedQuad = getNodeBounds(this.win, this.currentNode);
this._setPolygonPoints(quad, "transformed"); this._setPolygonPoints(untransformedQuad, "untransformed"); for (const nb of ["1", "2", "3", "4"]) { this._setLinePoints(
untransformedQuad["p" + nb],
quad["p" + nb], "line" + nb
);
}
// Adapt to the current zoom this.markup.scaleRootElement( this.currentNode, this.ID_CLASS_PREFIX + "root"
);
/** * Hide the highlighter, the outline and the infobar.
*/
_hide() {
setIgnoreLayoutChanges(true); this._hideShapes();
setIgnoreLayoutChanges( false, this.highlighterEnv.window.document.documentElement
);
}
¤ 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.0.14Bemerkung:
(vorverarbeitet)
¤
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.