* @see VIEW_COORD_SYS_ANIMATION_INTERRUPTION
(
viewInner: ViewInner,
hostModel: RoamHostComponentOrSeries,
otherModelsToSync: RoamHostComponentOrSeries[] | NullUndefined,
roamTrans: Transformable,
)
| 847 | * @see VIEW_COORD_SYS_ANIMATION_INTERRUPTION |
| 848 | */ |
| 849 | function syncBackToRoamOptionFromRoamTrans( |
| 850 | viewInner: ViewInner, |
| 851 | hostModel: RoamHostComponentOrSeries, |
| 852 | otherModelsToSync: RoamHostComponentOrSeries[] | NullUndefined, |
| 853 | roamTrans: Transformable, |
| 854 | ): void { |
| 855 | // This is the inverse operation of `viewCoordSysSetRoamOptionFromModel`. |
| 856 | const viewRectCenter = viewCoordSysGetViewRectCenter(viewInner); |
| 857 | const zoom = getZoomFromRoamTrans(roamTrans); |
| 858 | const notZoomNearZero = mathAbs(zoom) > 1e-6; |
| 859 | tmpCenterITR[0] = notZoomNearZero |
| 860 | ? (viewRectCenter[0] - roamTrans.x) / zoom |
| 861 | : viewRectCenter[0]; // Unlikely to occur. |
| 862 | tmpCenterITR[1] = notZoomNearZero |
| 863 | ? (viewRectCenter[1] - roamTrans.y) / zoom |
| 864 | : viewRectCenter[1]; // Unlikely to occur. |
| 865 | |
| 866 | vectorApplyTransform(tmpCenterITR, tmpCenterITR, viewInner.mtRawInv); |
| 867 | |
| 868 | const centerOption = invertBackToCenterOption(viewInner, tmpCenterITR); |
| 869 | syncBackRoamOptionToRoamHostModel(hostModel, centerOption, zoom); |
| 870 | each(otherModelsToSync, function (otherModel) { |
| 871 | if (otherModel !== hostModel) { |
| 872 | syncBackRoamOptionToRoamHostModel(otherModel, centerOption.slice(), zoom); |
| 873 | } |
| 874 | }); |
| 875 | } |
| 876 | const tmpCenterITR: number[] = []; |
| 877 | |
| 878 | /** |
no test coverage detected
searching dependent graphs…