Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: components.js
if (!(this.options.alwaysMeasureLayout && this.isLead()) &&
[24500] Fix | Delete
!this.isLayoutDirty) {
[24501] Fix | Delete
return;
[24502] Fix | Delete
}
[24503] Fix | Delete
/**
[24504] Fix | Delete
* When a node is mounted, it simply resumes from the prevLead's
[24505] Fix | Delete
* snapshot instead of taking a new one, but the ancestors scroll
[24506] Fix | Delete
* might have updated while the prevLead is unmounted. We need to
[24507] Fix | Delete
* update the scroll again to make sure the layout we measure is
[24508] Fix | Delete
* up to date.
[24509] Fix | Delete
*/
[24510] Fix | Delete
if (this.resumeFrom && !this.resumeFrom.instance) {
[24511] Fix | Delete
for (let i = 0; i < this.path.length; i++) {
[24512] Fix | Delete
const node = this.path[i];
[24513] Fix | Delete
node.updateScroll();
[24514] Fix | Delete
}
[24515] Fix | Delete
}
[24516] Fix | Delete
const prevLayout = this.layout;
[24517] Fix | Delete
this.layout = this.measure(false);
[24518] Fix | Delete
this.layoutCorrected = createBox();
[24519] Fix | Delete
this.isLayoutDirty = false;
[24520] Fix | Delete
this.projectionDelta = undefined;
[24521] Fix | Delete
this.notifyListeners("measure", this.layout.layoutBox);
[24522] Fix | Delete
const { visualElement } = this.options;
[24523] Fix | Delete
visualElement &&
[24524] Fix | Delete
visualElement.notify("LayoutMeasure", this.layout.layoutBox, prevLayout ? prevLayout.layoutBox : undefined);
[24525] Fix | Delete
}
[24526] Fix | Delete
updateScroll(phase = "measure") {
[24527] Fix | Delete
let needsMeasurement = Boolean(this.options.layoutScroll && this.instance);
[24528] Fix | Delete
if (this.scroll &&
[24529] Fix | Delete
this.scroll.animationId === this.root.animationId &&
[24530] Fix | Delete
this.scroll.phase === phase) {
[24531] Fix | Delete
needsMeasurement = false;
[24532] Fix | Delete
}
[24533] Fix | Delete
if (needsMeasurement) {
[24534] Fix | Delete
this.scroll = {
[24535] Fix | Delete
animationId: this.root.animationId,
[24536] Fix | Delete
phase,
[24537] Fix | Delete
isRoot: checkIsScrollRoot(this.instance),
[24538] Fix | Delete
offset: measureScroll(this.instance),
[24539] Fix | Delete
};
[24540] Fix | Delete
}
[24541] Fix | Delete
}
[24542] Fix | Delete
resetTransform() {
[24543] Fix | Delete
if (!resetTransform)
[24544] Fix | Delete
return;
[24545] Fix | Delete
const isResetRequested = this.isLayoutDirty || this.shouldResetTransform;
[24546] Fix | Delete
const hasProjection = this.projectionDelta && !isDeltaZero(this.projectionDelta);
[24547] Fix | Delete
const transformTemplate = this.getTransformTemplate();
[24548] Fix | Delete
const transformTemplateValue = transformTemplate
[24549] Fix | Delete
? transformTemplate(this.latestValues, "")
[24550] Fix | Delete
: undefined;
[24551] Fix | Delete
const transformTemplateHasChanged = transformTemplateValue !== this.prevTransformTemplateValue;
[24552] Fix | Delete
if (isResetRequested &&
[24553] Fix | Delete
(hasProjection ||
[24554] Fix | Delete
hasTransform(this.latestValues) ||
[24555] Fix | Delete
transformTemplateHasChanged)) {
[24556] Fix | Delete
resetTransform(this.instance, transformTemplateValue);
[24557] Fix | Delete
this.shouldResetTransform = false;
[24558] Fix | Delete
this.scheduleRender();
[24559] Fix | Delete
}
[24560] Fix | Delete
}
[24561] Fix | Delete
measure(removeTransform = true) {
[24562] Fix | Delete
const pageBox = this.measurePageBox();
[24563] Fix | Delete
let layoutBox = this.removeElementScroll(pageBox);
[24564] Fix | Delete
/**
[24565] Fix | Delete
* Measurements taken during the pre-render stage
[24566] Fix | Delete
* still have transforms applied so we remove them
[24567] Fix | Delete
* via calculation.
[24568] Fix | Delete
*/
[24569] Fix | Delete
if (removeTransform) {
[24570] Fix | Delete
layoutBox = this.removeTransform(layoutBox);
[24571] Fix | Delete
}
[24572] Fix | Delete
roundBox(layoutBox);
[24573] Fix | Delete
return {
[24574] Fix | Delete
animationId: this.root.animationId,
[24575] Fix | Delete
measuredBox: pageBox,
[24576] Fix | Delete
layoutBox,
[24577] Fix | Delete
latestValues: {},
[24578] Fix | Delete
source: this.id,
[24579] Fix | Delete
};
[24580] Fix | Delete
}
[24581] Fix | Delete
measurePageBox() {
[24582] Fix | Delete
const { visualElement } = this.options;
[24583] Fix | Delete
if (!visualElement)
[24584] Fix | Delete
return createBox();
[24585] Fix | Delete
const box = visualElement.measureViewportBox();
[24586] Fix | Delete
// Remove viewport scroll to give page-relative coordinates
[24587] Fix | Delete
const { scroll } = this.root;
[24588] Fix | Delete
if (scroll) {
[24589] Fix | Delete
translateAxis(box.x, scroll.offset.x);
[24590] Fix | Delete
translateAxis(box.y, scroll.offset.y);
[24591] Fix | Delete
}
[24592] Fix | Delete
return box;
[24593] Fix | Delete
}
[24594] Fix | Delete
removeElementScroll(box) {
[24595] Fix | Delete
const boxWithoutScroll = createBox();
[24596] Fix | Delete
copyBoxInto(boxWithoutScroll, box);
[24597] Fix | Delete
/**
[24598] Fix | Delete
* Performance TODO: Keep a cumulative scroll offset down the tree
[24599] Fix | Delete
* rather than loop back up the path.
[24600] Fix | Delete
*/
[24601] Fix | Delete
for (let i = 0; i < this.path.length; i++) {
[24602] Fix | Delete
const node = this.path[i];
[24603] Fix | Delete
const { scroll, options } = node;
[24604] Fix | Delete
if (node !== this.root && scroll && options.layoutScroll) {
[24605] Fix | Delete
/**
[24606] Fix | Delete
* If this is a new scroll root, we want to remove all previous scrolls
[24607] Fix | Delete
* from the viewport box.
[24608] Fix | Delete
*/
[24609] Fix | Delete
if (scroll.isRoot) {
[24610] Fix | Delete
copyBoxInto(boxWithoutScroll, box);
[24611] Fix | Delete
const { scroll: rootScroll } = this.root;
[24612] Fix | Delete
/**
[24613] Fix | Delete
* Undo the application of page scroll that was originally added
[24614] Fix | Delete
* to the measured bounding box.
[24615] Fix | Delete
*/
[24616] Fix | Delete
if (rootScroll) {
[24617] Fix | Delete
translateAxis(boxWithoutScroll.x, -rootScroll.offset.x);
[24618] Fix | Delete
translateAxis(boxWithoutScroll.y, -rootScroll.offset.y);
[24619] Fix | Delete
}
[24620] Fix | Delete
}
[24621] Fix | Delete
translateAxis(boxWithoutScroll.x, scroll.offset.x);
[24622] Fix | Delete
translateAxis(boxWithoutScroll.y, scroll.offset.y);
[24623] Fix | Delete
}
[24624] Fix | Delete
}
[24625] Fix | Delete
return boxWithoutScroll;
[24626] Fix | Delete
}
[24627] Fix | Delete
applyTransform(box, transformOnly = false) {
[24628] Fix | Delete
const withTransforms = createBox();
[24629] Fix | Delete
copyBoxInto(withTransforms, box);
[24630] Fix | Delete
for (let i = 0; i < this.path.length; i++) {
[24631] Fix | Delete
const node = this.path[i];
[24632] Fix | Delete
if (!transformOnly &&
[24633] Fix | Delete
node.options.layoutScroll &&
[24634] Fix | Delete
node.scroll &&
[24635] Fix | Delete
node !== node.root) {
[24636] Fix | Delete
transformBox(withTransforms, {
[24637] Fix | Delete
x: -node.scroll.offset.x,
[24638] Fix | Delete
y: -node.scroll.offset.y,
[24639] Fix | Delete
});
[24640] Fix | Delete
}
[24641] Fix | Delete
if (!hasTransform(node.latestValues))
[24642] Fix | Delete
continue;
[24643] Fix | Delete
transformBox(withTransforms, node.latestValues);
[24644] Fix | Delete
}
[24645] Fix | Delete
if (hasTransform(this.latestValues)) {
[24646] Fix | Delete
transformBox(withTransforms, this.latestValues);
[24647] Fix | Delete
}
[24648] Fix | Delete
return withTransforms;
[24649] Fix | Delete
}
[24650] Fix | Delete
removeTransform(box) {
[24651] Fix | Delete
const boxWithoutTransform = createBox();
[24652] Fix | Delete
copyBoxInto(boxWithoutTransform, box);
[24653] Fix | Delete
for (let i = 0; i < this.path.length; i++) {
[24654] Fix | Delete
const node = this.path[i];
[24655] Fix | Delete
if (!node.instance)
[24656] Fix | Delete
continue;
[24657] Fix | Delete
if (!hasTransform(node.latestValues))
[24658] Fix | Delete
continue;
[24659] Fix | Delete
hasScale(node.latestValues) && node.updateSnapshot();
[24660] Fix | Delete
const sourceBox = createBox();
[24661] Fix | Delete
const nodeBox = node.measurePageBox();
[24662] Fix | Delete
copyBoxInto(sourceBox, nodeBox);
[24663] Fix | Delete
removeBoxTransforms(boxWithoutTransform, node.latestValues, node.snapshot ? node.snapshot.layoutBox : undefined, sourceBox);
[24664] Fix | Delete
}
[24665] Fix | Delete
if (hasTransform(this.latestValues)) {
[24666] Fix | Delete
removeBoxTransforms(boxWithoutTransform, this.latestValues);
[24667] Fix | Delete
}
[24668] Fix | Delete
return boxWithoutTransform;
[24669] Fix | Delete
}
[24670] Fix | Delete
setTargetDelta(delta) {
[24671] Fix | Delete
this.targetDelta = delta;
[24672] Fix | Delete
this.root.scheduleUpdateProjection();
[24673] Fix | Delete
this.isProjectionDirty = true;
[24674] Fix | Delete
}
[24675] Fix | Delete
setOptions(options) {
[24676] Fix | Delete
this.options = {
[24677] Fix | Delete
...this.options,
[24678] Fix | Delete
...options,
[24679] Fix | Delete
crossfade: options.crossfade !== undefined ? options.crossfade : true,
[24680] Fix | Delete
};
[24681] Fix | Delete
}
[24682] Fix | Delete
clearMeasurements() {
[24683] Fix | Delete
this.scroll = undefined;
[24684] Fix | Delete
this.layout = undefined;
[24685] Fix | Delete
this.snapshot = undefined;
[24686] Fix | Delete
this.prevTransformTemplateValue = undefined;
[24687] Fix | Delete
this.targetDelta = undefined;
[24688] Fix | Delete
this.target = undefined;
[24689] Fix | Delete
this.isLayoutDirty = false;
[24690] Fix | Delete
}
[24691] Fix | Delete
forceRelativeParentToResolveTarget() {
[24692] Fix | Delete
if (!this.relativeParent)
[24693] Fix | Delete
return;
[24694] Fix | Delete
/**
[24695] Fix | Delete
* If the parent target isn't up-to-date, force it to update.
[24696] Fix | Delete
* This is an unfortunate de-optimisation as it means any updating relative
[24697] Fix | Delete
* projection will cause all the relative parents to recalculate back
[24698] Fix | Delete
* up the tree.
[24699] Fix | Delete
*/
[24700] Fix | Delete
if (this.relativeParent.resolvedRelativeTargetAt !==
[24701] Fix | Delete
frameData.timestamp) {
[24702] Fix | Delete
this.relativeParent.resolveTargetDelta(true);
[24703] Fix | Delete
}
[24704] Fix | Delete
}
[24705] Fix | Delete
resolveTargetDelta(forceRecalculation = false) {
[24706] Fix | Delete
var _a;
[24707] Fix | Delete
/**
[24708] Fix | Delete
* Once the dirty status of nodes has been spread through the tree, we also
[24709] Fix | Delete
* need to check if we have a shared node of a different depth that has itself
[24710] Fix | Delete
* been dirtied.
[24711] Fix | Delete
*/
[24712] Fix | Delete
const lead = this.getLead();
[24713] Fix | Delete
this.isProjectionDirty || (this.isProjectionDirty = lead.isProjectionDirty);
[24714] Fix | Delete
this.isTransformDirty || (this.isTransformDirty = lead.isTransformDirty);
[24715] Fix | Delete
this.isSharedProjectionDirty || (this.isSharedProjectionDirty = lead.isSharedProjectionDirty);
[24716] Fix | Delete
const isShared = Boolean(this.resumingFrom) || this !== lead;
[24717] Fix | Delete
/**
[24718] Fix | Delete
* We don't use transform for this step of processing so we don't
[24719] Fix | Delete
* need to check whether any nodes have changed transform.
[24720] Fix | Delete
*/
[24721] Fix | Delete
const canSkip = !(forceRecalculation ||
[24722] Fix | Delete
(isShared && this.isSharedProjectionDirty) ||
[24723] Fix | Delete
this.isProjectionDirty ||
[24724] Fix | Delete
((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty) ||
[24725] Fix | Delete
this.attemptToResolveRelativeTarget);
[24726] Fix | Delete
if (canSkip)
[24727] Fix | Delete
return;
[24728] Fix | Delete
const { layout, layoutId } = this.options;
[24729] Fix | Delete
/**
[24730] Fix | Delete
* If we have no layout, we can't perform projection, so early return
[24731] Fix | Delete
*/
[24732] Fix | Delete
if (!this.layout || !(layout || layoutId))
[24733] Fix | Delete
return;
[24734] Fix | Delete
this.resolvedRelativeTargetAt = frameData.timestamp;
[24735] Fix | Delete
/**
[24736] Fix | Delete
* If we don't have a targetDelta but do have a layout, we can attempt to resolve
[24737] Fix | Delete
* a relativeParent. This will allow a component to perform scale correction
[24738] Fix | Delete
* even if no animation has started.
[24739] Fix | Delete
*/
[24740] Fix | Delete
if (!this.targetDelta && !this.relativeTarget) {
[24741] Fix | Delete
const relativeParent = this.getClosestProjectingParent();
[24742] Fix | Delete
if (relativeParent &&
[24743] Fix | Delete
relativeParent.layout &&
[24744] Fix | Delete
this.animationProgress !== 1) {
[24745] Fix | Delete
this.relativeParent = relativeParent;
[24746] Fix | Delete
this.forceRelativeParentToResolveTarget();
[24747] Fix | Delete
this.relativeTarget = createBox();
[24748] Fix | Delete
this.relativeTargetOrigin = createBox();
[24749] Fix | Delete
calcRelativePosition(this.relativeTargetOrigin, this.layout.layoutBox, relativeParent.layout.layoutBox);
[24750] Fix | Delete
copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);
[24751] Fix | Delete
}
[24752] Fix | Delete
else {
[24753] Fix | Delete
this.relativeParent = this.relativeTarget = undefined;
[24754] Fix | Delete
}
[24755] Fix | Delete
}
[24756] Fix | Delete
/**
[24757] Fix | Delete
* If we have no relative target or no target delta our target isn't valid
[24758] Fix | Delete
* for this frame.
[24759] Fix | Delete
*/
[24760] Fix | Delete
if (!this.relativeTarget && !this.targetDelta)
[24761] Fix | Delete
return;
[24762] Fix | Delete
/**
[24763] Fix | Delete
* Lazy-init target data structure
[24764] Fix | Delete
*/
[24765] Fix | Delete
if (!this.target) {
[24766] Fix | Delete
this.target = createBox();
[24767] Fix | Delete
this.targetWithTransforms = createBox();
[24768] Fix | Delete
}
[24769] Fix | Delete
/**
[24770] Fix | Delete
* If we've got a relative box for this component, resolve it into a target relative to the parent.
[24771] Fix | Delete
*/
[24772] Fix | Delete
if (this.relativeTarget &&
[24773] Fix | Delete
this.relativeTargetOrigin &&
[24774] Fix | Delete
this.relativeParent &&
[24775] Fix | Delete
this.relativeParent.target) {
[24776] Fix | Delete
this.forceRelativeParentToResolveTarget();
[24777] Fix | Delete
calcRelativeBox(this.target, this.relativeTarget, this.relativeParent.target);
[24778] Fix | Delete
/**
[24779] Fix | Delete
* If we've only got a targetDelta, resolve it into a target
[24780] Fix | Delete
*/
[24781] Fix | Delete
}
[24782] Fix | Delete
else if (this.targetDelta) {
[24783] Fix | Delete
if (Boolean(this.resumingFrom)) {
[24784] Fix | Delete
// TODO: This is creating a new object every frame
[24785] Fix | Delete
this.target = this.applyTransform(this.layout.layoutBox);
[24786] Fix | Delete
}
[24787] Fix | Delete
else {
[24788] Fix | Delete
copyBoxInto(this.target, this.layout.layoutBox);
[24789] Fix | Delete
}
[24790] Fix | Delete
applyBoxDelta(this.target, this.targetDelta);
[24791] Fix | Delete
}
[24792] Fix | Delete
else {
[24793] Fix | Delete
/**
[24794] Fix | Delete
* If no target, use own layout as target
[24795] Fix | Delete
*/
[24796] Fix | Delete
copyBoxInto(this.target, this.layout.layoutBox);
[24797] Fix | Delete
}
[24798] Fix | Delete
/**
[24799] Fix | Delete
* If we've been told to attempt to resolve a relative target, do so.
[24800] Fix | Delete
*/
[24801] Fix | Delete
if (this.attemptToResolveRelativeTarget) {
[24802] Fix | Delete
this.attemptToResolveRelativeTarget = false;
[24803] Fix | Delete
const relativeParent = this.getClosestProjectingParent();
[24804] Fix | Delete
if (relativeParent &&
[24805] Fix | Delete
Boolean(relativeParent.resumingFrom) ===
[24806] Fix | Delete
Boolean(this.resumingFrom) &&
[24807] Fix | Delete
!relativeParent.options.layoutScroll &&
[24808] Fix | Delete
relativeParent.target &&
[24809] Fix | Delete
this.animationProgress !== 1) {
[24810] Fix | Delete
this.relativeParent = relativeParent;
[24811] Fix | Delete
this.forceRelativeParentToResolveTarget();
[24812] Fix | Delete
this.relativeTarget = createBox();
[24813] Fix | Delete
this.relativeTargetOrigin = createBox();
[24814] Fix | Delete
calcRelativePosition(this.relativeTargetOrigin, this.target, relativeParent.target);
[24815] Fix | Delete
copyBoxInto(this.relativeTarget, this.relativeTargetOrigin);
[24816] Fix | Delete
}
[24817] Fix | Delete
else {
[24818] Fix | Delete
this.relativeParent = this.relativeTarget = undefined;
[24819] Fix | Delete
}
[24820] Fix | Delete
}
[24821] Fix | Delete
/**
[24822] Fix | Delete
* Increase debug counter for resolved target deltas
[24823] Fix | Delete
*/
[24824] Fix | Delete
projectionFrameData.resolvedTargetDeltas++;
[24825] Fix | Delete
}
[24826] Fix | Delete
getClosestProjectingParent() {
[24827] Fix | Delete
if (!this.parent ||
[24828] Fix | Delete
hasScale(this.parent.latestValues) ||
[24829] Fix | Delete
has2DTranslate(this.parent.latestValues)) {
[24830] Fix | Delete
return undefined;
[24831] Fix | Delete
}
[24832] Fix | Delete
if (this.parent.isProjecting()) {
[24833] Fix | Delete
return this.parent;
[24834] Fix | Delete
}
[24835] Fix | Delete
else {
[24836] Fix | Delete
return this.parent.getClosestProjectingParent();
[24837] Fix | Delete
}
[24838] Fix | Delete
}
[24839] Fix | Delete
isProjecting() {
[24840] Fix | Delete
return Boolean((this.relativeTarget ||
[24841] Fix | Delete
this.targetDelta ||
[24842] Fix | Delete
this.options.layoutRoot) &&
[24843] Fix | Delete
this.layout);
[24844] Fix | Delete
}
[24845] Fix | Delete
calcProjection() {
[24846] Fix | Delete
var _a;
[24847] Fix | Delete
const lead = this.getLead();
[24848] Fix | Delete
const isShared = Boolean(this.resumingFrom) || this !== lead;
[24849] Fix | Delete
let canSkip = true;
[24850] Fix | Delete
/**
[24851] Fix | Delete
* If this is a normal layout animation and neither this node nor its nearest projecting
[24852] Fix | Delete
* is dirty then we can't skip.
[24853] Fix | Delete
*/
[24854] Fix | Delete
if (this.isProjectionDirty || ((_a = this.parent) === null || _a === void 0 ? void 0 : _a.isProjectionDirty)) {
[24855] Fix | Delete
canSkip = false;
[24856] Fix | Delete
}
[24857] Fix | Delete
/**
[24858] Fix | Delete
* If this is a shared layout animation and this node's shared projection is dirty then
[24859] Fix | Delete
* we can't skip.
[24860] Fix | Delete
*/
[24861] Fix | Delete
if (isShared &&
[24862] Fix | Delete
(this.isSharedProjectionDirty || this.isTransformDirty)) {
[24863] Fix | Delete
canSkip = false;
[24864] Fix | Delete
}
[24865] Fix | Delete
/**
[24866] Fix | Delete
* If we have resolved the target this frame we must recalculate the
[24867] Fix | Delete
* projection to ensure it visually represents the internal calculations.
[24868] Fix | Delete
*/
[24869] Fix | Delete
if (this.resolvedRelativeTargetAt === frameData.timestamp) {
[24870] Fix | Delete
canSkip = false;
[24871] Fix | Delete
}
[24872] Fix | Delete
if (canSkip)
[24873] Fix | Delete
return;
[24874] Fix | Delete
const { layout, layoutId } = this.options;
[24875] Fix | Delete
/**
[24876] Fix | Delete
* If this section of the tree isn't animating we can
[24877] Fix | Delete
* delete our target sources for the following frame.
[24878] Fix | Delete
*/
[24879] Fix | Delete
this.isTreeAnimating = Boolean((this.parent && this.parent.isTreeAnimating) ||
[24880] Fix | Delete
this.currentAnimation ||
[24881] Fix | Delete
this.pendingAnimation);
[24882] Fix | Delete
if (!this.isTreeAnimating) {
[24883] Fix | Delete
this.targetDelta = this.relativeTarget = undefined;
[24884] Fix | Delete
}
[24885] Fix | Delete
if (!this.layout || !(layout || layoutId))
[24886] Fix | Delete
return;
[24887] Fix | Delete
/**
[24888] Fix | Delete
* Reset the corrected box with the latest values from box, as we're then going
[24889] Fix | Delete
* to perform mutative operations on it.
[24890] Fix | Delete
*/
[24891] Fix | Delete
copyBoxInto(this.layoutCorrected, this.layout.layoutBox);
[24892] Fix | Delete
/**
[24893] Fix | Delete
* Record previous tree scales before updating.
[24894] Fix | Delete
*/
[24895] Fix | Delete
const prevTreeScaleX = this.treeScale.x;
[24896] Fix | Delete
const prevTreeScaleY = this.treeScale.y;
[24897] Fix | Delete
/**
[24898] Fix | Delete
* Apply all the parent deltas to this box to produce the corrected box. This
[24899] Fix | Delete
* is the layout box, as it will appear on screen as a result of the transforms of its parents.
[24900] Fix | Delete
*/
[24901] Fix | Delete
applyTreeDeltas(this.layoutCorrected, this.treeScale, this.path, isShared);
[24902] Fix | Delete
/**
[24903] Fix | Delete
* If this layer needs to perform scale correction but doesn't have a target,
[24904] Fix | Delete
* use the layout as the target.
[24905] Fix | Delete
*/
[24906] Fix | Delete
if (lead.layout &&
[24907] Fix | Delete
!lead.target &&
[24908] Fix | Delete
(this.treeScale.x !== 1 || this.treeScale.y !== 1)) {
[24909] Fix | Delete
lead.target = lead.layout.layoutBox;
[24910] Fix | Delete
lead.targetWithTransforms = createBox();
[24911] Fix | Delete
}
[24912] Fix | Delete
const { target } = lead;
[24913] Fix | Delete
if (!target) {
[24914] Fix | Delete
/**
[24915] Fix | Delete
* If we don't have a target to project into, but we were previously
[24916] Fix | Delete
* projecting, we want to remove the stored transform and schedule
[24917] Fix | Delete
* a render to ensure the elements reflect the removed transform.
[24918] Fix | Delete
*/
[24919] Fix | Delete
if (this.projectionTransform) {
[24920] Fix | Delete
this.projectionDelta = createDelta();
[24921] Fix | Delete
this.projectionTransform = "none";
[24922] Fix | Delete
this.scheduleRender();
[24923] Fix | Delete
}
[24924] Fix | Delete
return;
[24925] Fix | Delete
}
[24926] Fix | Delete
if (!this.projectionDelta) {
[24927] Fix | Delete
this.projectionDelta = createDelta();
[24928] Fix | Delete
this.projectionDeltaWithTransform = createDelta();
[24929] Fix | Delete
}
[24930] Fix | Delete
const prevProjectionTransform = this.projectionTransform;
[24931] Fix | Delete
/**
[24932] Fix | Delete
* Update the delta between the corrected box and the target box before user-set transforms were applied.
[24933] Fix | Delete
* This will allow us to calculate the corrected borderRadius and boxShadow to compensate
[24934] Fix | Delete
* for our layout reprojection, but still allow them to be scaled correctly by the user.
[24935] Fix | Delete
* It might be that to simplify this we may want to accept that user-set scale is also corrected
[24936] Fix | Delete
* and we wouldn't have to keep and calc both deltas, OR we could support a user setting
[24937] Fix | Delete
* to allow people to choose whether these styles are corrected based on just the
[24938] Fix | Delete
* layout reprojection or the final bounding box.
[24939] Fix | Delete
*/
[24940] Fix | Delete
calcBoxDelta(this.projectionDelta, this.layoutCorrected, target, this.latestValues);
[24941] Fix | Delete
this.projectionTransform = buildProjectionTransform(this.projectionDelta, this.treeScale);
[24942] Fix | Delete
if (this.projectionTransform !== prevProjectionTransform ||
[24943] Fix | Delete
this.treeScale.x !== prevTreeScaleX ||
[24944] Fix | Delete
this.treeScale.y !== prevTreeScaleY) {
[24945] Fix | Delete
this.hasProjected = true;
[24946] Fix | Delete
this.scheduleRender();
[24947] Fix | Delete
this.notifyListeners("projectionUpdate", target);
[24948] Fix | Delete
}
[24949] Fix | Delete
/**
[24950] Fix | Delete
* Increase debug counter for recalculated projections
[24951] Fix | Delete
*/
[24952] Fix | Delete
projectionFrameData.recalculatedProjection++;
[24953] Fix | Delete
}
[24954] Fix | Delete
hide() {
[24955] Fix | Delete
this.isVisible = false;
[24956] Fix | Delete
// TODO: Schedule render
[24957] Fix | Delete
}
[24958] Fix | Delete
show() {
[24959] Fix | Delete
this.isVisible = true;
[24960] Fix | Delete
// TODO: Schedule render
[24961] Fix | Delete
}
[24962] Fix | Delete
scheduleRender(notifyAll = true) {
[24963] Fix | Delete
this.options.scheduleRender && this.options.scheduleRender();
[24964] Fix | Delete
if (notifyAll) {
[24965] Fix | Delete
const stack = this.getStack();
[24966] Fix | Delete
stack && stack.scheduleRender();
[24967] Fix | Delete
}
[24968] Fix | Delete
if (this.resumingFrom && !this.resumingFrom.instance) {
[24969] Fix | Delete
this.resumingFrom = undefined;
[24970] Fix | Delete
}
[24971] Fix | Delete
}
[24972] Fix | Delete
setAnimationOrigin(delta, hasOnlyRelativeTargetChanged = false) {
[24973] Fix | Delete
const snapshot = this.snapshot;
[24974] Fix | Delete
const snapshotLatestValues = snapshot
[24975] Fix | Delete
? snapshot.latestValues
[24976] Fix | Delete
: {};
[24977] Fix | Delete
const mixedValues = { ...this.latestValues };
[24978] Fix | Delete
const targetDelta = createDelta();
[24979] Fix | Delete
if (!this.relativeParent ||
[24980] Fix | Delete
!this.relativeParent.options.layoutRoot) {
[24981] Fix | Delete
this.relativeTarget = this.relativeTargetOrigin = undefined;
[24982] Fix | Delete
}
[24983] Fix | Delete
this.attemptToResolveRelativeTarget = !hasOnlyRelativeTargetChanged;
[24984] Fix | Delete
const relativeLayout = createBox();
[24985] Fix | Delete
const snapshotSource = snapshot ? snapshot.source : undefined;
[24986] Fix | Delete
const layoutSource = this.layout ? this.layout.source : undefined;
[24987] Fix | Delete
const isSharedLayoutAnimation = snapshotSource !== layoutSource;
[24988] Fix | Delete
const stack = this.getStack();
[24989] Fix | Delete
const isOnlyMember = !stack || stack.members.length <= 1;
[24990] Fix | Delete
const shouldCrossfadeOpacity = Boolean(isSharedLayoutAnimation &&
[24991] Fix | Delete
!isOnlyMember &&
[24992] Fix | Delete
this.options.crossfade === true &&
[24993] Fix | Delete
!this.path.some(hasOpacityCrossfade));
[24994] Fix | Delete
this.animationProgress = 0;
[24995] Fix | Delete
let prevRelativeTarget;
[24996] Fix | Delete
this.mixTargetDelta = (latest) => {
[24997] Fix | Delete
const progress = latest / 1000;
[24998] Fix | Delete
mixAxisDelta(targetDelta.x, delta.x, progress);
[24999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function