@sapui5/sap.ui.vk 1.140.0 → 1.141.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sap/ui/vk/.library +1 -1
- package/src/sap/ui/vk/AnimationPlayback.js +1 -1
- package/src/sap/ui/vk/AnimationPlayer.js +1 -1
- package/src/sap/ui/vk/AnimationSequence.js +1 -1
- package/src/sap/ui/vk/AnimationTimeSlider.js +1 -1
- package/src/sap/ui/vk/AnimationTrack.js +1 -1
- package/src/sap/ui/vk/Annotation.js +1 -1
- package/src/sap/ui/vk/BaseNodeProxy.js +1 -1
- package/src/sap/ui/vk/Camera.js +1 -1
- package/src/sap/ui/vk/ContentConnector.js +1 -1
- package/src/sap/ui/vk/ContentManager.js +1 -1
- package/src/sap/ui/vk/ContentResource.js +1 -1
- package/src/sap/ui/vk/Core.js +1 -1
- package/src/sap/ui/vk/DownloadManager.js +1 -1
- package/src/sap/ui/vk/DrawerToolbar.js +1 -1
- package/src/sap/ui/vk/DvlException.js +1 -1
- package/src/sap/ui/vk/FlexibleControl.js +1 -1
- package/src/sap/ui/vk/FlexibleControlLayoutData.js +1 -1
- package/src/sap/ui/vk/Highlight.js +1 -1
- package/src/sap/ui/vk/ImageContentManager.js +1 -1
- package/src/sap/ui/vk/JointUtils.js +1 -1
- package/src/sap/ui/vk/LayerProxy.js +1 -1
- package/src/sap/ui/vk/Loco.js +1 -1
- package/src/sap/ui/vk/Material.js +1 -1
- package/src/sap/ui/vk/NativeViewport.js +1 -1
- package/src/sap/ui/vk/NodeContentType.js +6 -1
- package/src/sap/ui/vk/NodeHierarchy.js +1 -1
- package/src/sap/ui/vk/NodeProxy.js +1 -1
- package/src/sap/ui/vk/NodeUtils.js +1 -1
- package/src/sap/ui/vk/Notifications.js +1 -1
- package/src/sap/ui/vk/ObjectType.js +2 -1
- package/src/sap/ui/vk/OrthographicCamera.js +1 -1
- package/src/sap/ui/vk/PerspectiveCamera.js +1 -1
- package/src/sap/ui/vk/ProgressIndicator.js +1 -1
- package/src/sap/ui/vk/RedlineCollaboration.js +1 -1
- package/src/sap/ui/vk/RedlineConversation.js +1 -1
- package/src/sap/ui/vk/RedlineDesign.js +1 -1
- package/src/sap/ui/vk/RedlineElement.js +1 -1
- package/src/sap/ui/vk/RedlineElementComment.js +1 -1
- package/src/sap/ui/vk/RedlineElementEllipse.js +1 -1
- package/src/sap/ui/vk/RedlineElementFreehand.js +1 -1
- package/src/sap/ui/vk/RedlineElementLine.js +1 -1
- package/src/sap/ui/vk/RedlineElementRectangle.js +1 -1
- package/src/sap/ui/vk/RedlineElementText.js +1 -1
- package/src/sap/ui/vk/RedlineSurface.js +1 -1
- package/src/sap/ui/vk/SafeArea.js +1 -1
- package/src/sap/ui/vk/Scene.js +1 -1
- package/src/sap/ui/vk/SceneTree.js +1 -1
- package/src/sap/ui/vk/StepNavigation.js +1 -1
- package/src/sap/ui/vk/Texture.js +1 -1
- package/src/sap/ui/vk/ToggleMenuButton.js +1 -1
- package/src/sap/ui/vk/ToggleMenuItem.js +1 -1
- package/src/sap/ui/vk/Toolbar.js +1 -1
- package/src/sap/ui/vk/View.js +1 -1
- package/src/sap/ui/vk/ViewGallery.js +1 -1
- package/src/sap/ui/vk/ViewGalleryThumbnail.js +1 -1
- package/src/sap/ui/vk/ViewGroup.js +1 -1
- package/src/sap/ui/vk/ViewManager.js +1 -1
- package/src/sap/ui/vk/ViewStateManager.js +1 -1
- package/src/sap/ui/vk/ViewStateManagerBase.js +1 -1
- package/src/sap/ui/vk/Viewer.js +1 -1
- package/src/sap/ui/vk/Viewport.js +43 -1
- package/src/sap/ui/vk/ViewportBase.js +24 -1
- package/src/sap/ui/vk/dvl/BaseNodeProxy.js +1 -1
- package/src/sap/ui/vk/dvl/ContentManager.js +1 -1
- package/src/sap/ui/vk/dvl/GraphicsCore.js +1 -1
- package/src/sap/ui/vk/dvl/LayerProxy.js +1 -1
- package/src/sap/ui/vk/dvl/NodeHierarchy.js +1 -1
- package/src/sap/ui/vk/dvl/NodeProxy.js +1 -1
- package/src/sap/ui/vk/dvl/Scene.js +1 -1
- package/src/sap/ui/vk/dvl/ViewStateManager.js +1 -1
- package/src/sap/ui/vk/dvl/Viewport.js +2 -2
- package/src/sap/ui/vk/ecad/ElementsPanel.js +352 -141
- package/src/sap/ui/vk/ecad/LayersPanel.js +1 -1
- package/src/sap/ui/vk/i18n/messagebundle_ar.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_bg.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_ca.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_cnr.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_cs.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_cy.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_da.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_de.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_el.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_en.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_en_GB.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_es.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_es_MX.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_et.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_fi.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_fr.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_fr_CA.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_hi.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_hr.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_hu.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_id.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_it.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_iw.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_ja.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_kk.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_ko.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_lt.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_lv.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_mk.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_ms.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_nl.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_no.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_pl.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_pt.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_pt_PT.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_ro.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_ru.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_sh.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_sk.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_sl.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_sr.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_sv.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_th.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_tr.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_uk.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_vi.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_zh_CN.properties +0 -2
- package/src/sap/ui/vk/i18n/messagebundle_zh_TW.properties +0 -2
- package/src/sap/ui/vk/library.js +2 -2
- package/src/sap/ui/vk/measurements/Angle.js +1 -1
- package/src/sap/ui/vk/measurements/Area.js +1 -1
- package/src/sap/ui/vk/measurements/Distance.js +1 -1
- package/src/sap/ui/vk/measurements/Edge.js +1 -1
- package/src/sap/ui/vk/measurements/Face.js +1 -1
- package/src/sap/ui/vk/measurements/Feature.js +1 -1
- package/src/sap/ui/vk/measurements/Vertex.js +1 -1
- package/src/sap/ui/vk/pdf/ContentManager.js +85 -13
- package/src/sap/ui/vk/pdf/Viewport.js +1 -1
- package/src/sap/ui/vk/svg/BaseNodeProxy.js +1 -1
- package/src/sap/ui/vk/svg/ContentDeliveryService.js +1 -1
- package/src/sap/ui/vk/svg/ContentManager.js +2 -1
- package/src/sap/ui/vk/svg/Element.js +162 -23
- package/src/sap/ui/vk/svg/Ellipse.js +4 -0
- package/src/sap/ui/vk/svg/HotspotHelper.js +30 -17
- package/src/sap/ui/vk/svg/MiniMap.js +63 -1
- package/src/sap/ui/vk/svg/NodeHierarchy.js +17 -1
- package/src/sap/ui/vk/svg/NodeProxy.js +1 -1
- package/src/sap/ui/vk/svg/OrthographicCamera.js +1 -1
- package/src/sap/ui/vk/svg/Scene.js +1 -1
- package/src/sap/ui/vk/svg/SceneBuilder.js +57 -5
- package/src/sap/ui/vk/svg/Text.js +72 -30
- package/src/sap/ui/vk/svg/ViewStateManager.js +2 -2
- package/src/sap/ui/vk/svg/Viewport.js +178 -32
- package/src/sap/ui/vk/svg/ViewportRenderer.js +82 -0
- package/src/sap/ui/vk/thirdparty/pdf.js +18003 -13388
- package/src/sap/ui/vk/thirdparty/pdf.worker.js +38149 -36166
- package/src/sap/ui/vk/threejs/AnimationHelper.js +1 -1
- package/src/sap/ui/vk/threejs/BaseNodeProxy.js +1 -1
- package/src/sap/ui/vk/threejs/Billboard.js +1 -1
- package/src/sap/ui/vk/threejs/Callout.js +1 -1
- package/src/sap/ui/vk/threejs/ContentDeliveryService.js +1 -1
- package/src/sap/ui/vk/threejs/ContentManager.js +1 -1
- package/src/sap/ui/vk/threejs/DetailView.js +1 -1
- package/src/sap/ui/vk/threejs/HighlightPlayer.js +1 -1
- package/src/sap/ui/vk/threejs/Material.js +1 -1
- package/src/sap/ui/vk/threejs/NodeHierarchy.js +1 -1
- package/src/sap/ui/vk/threejs/NodeProxy.js +1 -1
- package/src/sap/ui/vk/threejs/OrthographicCamera.js +1 -1
- package/src/sap/ui/vk/threejs/PerspectiveCamera.js +1 -1
- package/src/sap/ui/vk/threejs/PointCloudGroup.js +1 -1
- package/src/sap/ui/vk/threejs/Scene.js +1 -1
- package/src/sap/ui/vk/threejs/SceneBuilder.js +12 -1
- package/src/sap/ui/vk/threejs/Texture.js +1 -1
- package/src/sap/ui/vk/threejs/Thrustline.js +1 -1
- package/src/sap/ui/vk/threejs/ViewStateManager.js +3 -3
- package/src/sap/ui/vk/threejs/Viewport.js +1 -1
- package/src/sap/ui/vk/tools/AnchorPointTool.js +1 -1
- package/src/sap/ui/vk/tools/AnchorPointToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/AxisAngleRotationTool.js +1 -1
- package/src/sap/ui/vk/tools/AxisAngleRotationToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreateEllipseTool.js +1 -1
- package/src/sap/ui/vk/tools/CreateEllipseToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreateParametricGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreatePathTool.js +1 -1
- package/src/sap/ui/vk/tools/CreatePathToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreateRectangleTool.js +1 -1
- package/src/sap/ui/vk/tools/CreateRectangleToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CreateTextTool.js +1 -1
- package/src/sap/ui/vk/tools/CreateTextToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/CrossSectionTool.js +1 -1
- package/src/sap/ui/vk/tools/CrossSectionToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/DuplicateSvgElementTool.js +1 -1
- package/src/sap/ui/vk/tools/DuplicateSvgElementToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/ExplodeTool.js +1 -1
- package/src/sap/ui/vk/tools/ExplodeToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/Gizmo.js +1 -1
- package/src/sap/ui/vk/tools/HitTestTool.js +1 -1
- package/src/sap/ui/vk/tools/MoveTool.js +1 -1
- package/src/sap/ui/vk/tools/MoveToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/PointCloudSelectionTool.js +1 -1
- package/src/sap/ui/vk/tools/PointCloudSelectionToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/RectSelectTool.js +1 -1
- package/src/sap/ui/vk/tools/RedlineTool.js +1 -1
- package/src/sap/ui/vk/tools/RedlineToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/RotateOrbitTool.js +1 -1
- package/src/sap/ui/vk/tools/RotateTool.js +1 -1
- package/src/sap/ui/vk/tools/RotateToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/RotateTurntableTool.js +1 -1
- package/src/sap/ui/vk/tools/ScaleTool.js +1 -1
- package/src/sap/ui/vk/tools/ScaleToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/SceneOrientationTool.js +1 -1
- package/src/sap/ui/vk/tools/SceneOrientationToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/Tool.js +1 -1
- package/src/sap/ui/vk/tools/TooltipTool.js +1 -1
- package/src/sap/ui/vk/tools/TooltipToolGizmo.js +1 -1
- package/src/sap/ui/vk/tools/TransformSvgElementTool.js +1 -1
- package/src/sap/ui/vk/tools/TransformSvgElementToolGizmo.js +3 -3
- package/src/sap/ui/vk/tools/TransformSvgElementToolHandler.js +1 -1
- package/src/sap/ui/vk/totara/Command.js +1 -0
- package/src/sap/ui/vk/totara/SceneContext.js +23 -1
- package/src/sap/ui/vk/totara/TotaraLoader.js +1 -0
- package/src/sap/ui/vk/totara/TotaraLoaderWorker.js +16 -0
- package/src/sap/ui/vk/totara/TotaraUtils.js +3 -1
- package/src/sap/ui/vk/ve/dvl.wasm +0 -0
|
@@ -66,7 +66,7 @@ sap.ui.define([
|
|
|
66
66
|
*
|
|
67
67
|
* @private
|
|
68
68
|
* @author SAP SE
|
|
69
|
-
* @version 1.
|
|
69
|
+
* @version 1.141.0
|
|
70
70
|
*/
|
|
71
71
|
var SceneBuilder = function(rootNode, contentResource, resolve, reject) {
|
|
72
72
|
this._rootNode = rootNode;
|
|
@@ -122,14 +122,37 @@ sap.ui.define([
|
|
|
122
122
|
*/
|
|
123
123
|
SceneBuilder.prototype.setScene = function(info) {
|
|
124
124
|
this._yIndex = 1; // VDS4 file geometry data
|
|
125
|
-
this._rootNode.matrix[3] = info.upAxis === 2 ? -1 : 1; // (0 = +X, 1 = -X, 2 = +Y, 3 = -Y, 4 = +Z, 5 = -Z)
|
|
126
|
-
|
|
125
|
+
this._rootNode.matrix[3] = info.upAxis === 2 || info.upAxis === 4 ? -1 : 1; // (0 = +X, 1 = -X, 2 = +Y, 3 = -Y, 4 = +Z, 5 = -Z)
|
|
126
|
+
const camera = this._cameras.get(info.cameraId);
|
|
127
|
+
const outputSettings = info.outputSettings;
|
|
128
|
+
if (outputSettings && camera) {
|
|
129
|
+
// update line width in materials if coordinate space is in device/paper units
|
|
130
|
+
const outputDPI = 72; // ignore outputSettings.dpi as VEA ignores DPI setting and always uses 72 DPI
|
|
131
|
+
const mmToInch = 1 / 25.4; // 1 inch = 25.4 mm
|
|
132
|
+
const pointToPixel = 4 / 3; // 1 inch = 72 points(common for older screens) = 96 pixels(standard web displays), so 1 point = 96 / 72 pixels = 4 / 3 pixels
|
|
133
|
+
const mmToPixels = mmToInch * outputDPI * pointToPixel; // convert mm to pixels (mm -> inches -> points -> pixels)
|
|
134
|
+
const outputSize = Math.min(outputSettings.width, outputSettings.height) * mmToPixels;
|
|
135
|
+
|
|
136
|
+
this._materialMap.forEach(function(material) {
|
|
137
|
+
if (material.lineStyle.widthCoordinateSpace === 4) { // sap::ve::core::Material::CoordinateSpace::Device (device/paper units)
|
|
138
|
+
if (!info.showPaperSpace) {
|
|
139
|
+
// this mode has a weird behavior in VE Author, the line thickness is measured in weird units that are converted
|
|
140
|
+
// to pixels (doesn't depend on the zoom factor), but it depends on the viewport size
|
|
141
|
+
material.lineWidth = material.lineStyle.width * 1024 / outputSize; // 1024 is a medium viewport size in pixels
|
|
142
|
+
material.lineStyle.widthCoordinateSpace = 0; // convert to screen space
|
|
143
|
+
}
|
|
144
|
+
// material.lineWidth = material.lineStyle.width / (outputSize * camera._initialZoom);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
127
149
|
Log.info("setScene", JSON.stringify(info), camera);
|
|
128
150
|
this._resolve?.({
|
|
129
151
|
node: this._rootNode,
|
|
130
|
-
camera
|
|
152
|
+
camera,
|
|
131
153
|
backgroundTopColor: info.backgroundTopColor,
|
|
132
154
|
backgroundBottomColor: info.backgroundBottomColor,
|
|
155
|
+
outputSettings,
|
|
133
156
|
contentResource: this._contentResource,
|
|
134
157
|
builder: this
|
|
135
158
|
});
|
|
@@ -691,6 +714,7 @@ sap.ui.define([
|
|
|
691
714
|
* @param {any} nodeInfo The node information object containing the following properties <br/>
|
|
692
715
|
* <code>sid</code>: String. The id of node.
|
|
693
716
|
* <code>parametricId</code>: String. The id of object's parametric representation.
|
|
717
|
+
* <code>dynamicContentId</code>: String. The id of object's dynamic content representation.
|
|
694
718
|
* <code>name</code>: String. The name of the node. Optional.<br/>
|
|
695
719
|
* <code>visible</code>: Boolean. True if the node is visible. Default true. Optional<br/>
|
|
696
720
|
* <code>visualisable</code>: Boolean. False if the node is skipped. Default true. Optional<br/>
|
|
@@ -737,12 +761,14 @@ sap.ui.define([
|
|
|
737
761
|
|
|
738
762
|
if (nodeInfo.parametricId) {
|
|
739
763
|
userData.parametricId = nodeInfo.parametricId;
|
|
764
|
+
} else if (nodeInfo.dynamicContentId) {
|
|
765
|
+
userData.dynamicContentId = nodeInfo.dynamicContentId;
|
|
740
766
|
} else if (nodeInfo.meshId) {
|
|
741
767
|
this._setMeshNode(node, nodeInfo.meshId);
|
|
742
768
|
}
|
|
743
769
|
|
|
744
770
|
userData.treeNode = nodeInfo;
|
|
745
|
-
node.setVisible(1, nodeInfo.visible
|
|
771
|
+
node.setVisible(1, nodeInfo.visible ?? true);
|
|
746
772
|
|
|
747
773
|
if (nodeInfo.visualisable === false) {
|
|
748
774
|
userData.skipIt = true; // Don't display this node in scene tree
|
|
@@ -778,6 +804,8 @@ sap.ui.define([
|
|
|
778
804
|
|
|
779
805
|
if (nodeInfo.contentType === "HOTSPOT") {
|
|
780
806
|
node._vkSetNodeContentType(NodeContentType.Hotspot);
|
|
807
|
+
} else if (nodeInfo.contentType === "DYNAMIC_CONTENT") {
|
|
808
|
+
node._vkSetNodeContentType(NodeContentType.DynamicContent);
|
|
781
809
|
} else if (nodeInfo.contentType === "ANNOTATION") {
|
|
782
810
|
node._vkSetNodeContentType(NodeContentType.Annotation);
|
|
783
811
|
} else if (nodeInfo.contentType === "SVG") {
|
|
@@ -994,6 +1022,28 @@ sap.ui.define([
|
|
|
994
1022
|
}
|
|
995
1023
|
};
|
|
996
1024
|
|
|
1025
|
+
/**
|
|
1026
|
+
* Set dynamic content (represented as "parametric rectange") to scene node
|
|
1027
|
+
* @param {string} nodeId Identifier of the node which will have dynamic content assigned
|
|
1028
|
+
* @param {any} dynamicContent The dynamic content object
|
|
1029
|
+
* @param {any} sceneId The scene identifier
|
|
1030
|
+
* @public
|
|
1031
|
+
*/
|
|
1032
|
+
SceneBuilder.prototype.setDynamicContent = function(nodeId, dynamicContent, sceneId) {
|
|
1033
|
+
this._resetCurrentScene(sceneId);
|
|
1034
|
+
const node = this._nodes.get(nodeId);
|
|
1035
|
+
if (node) {
|
|
1036
|
+
node.userData.templateId = dynamicContent.templateId;
|
|
1037
|
+
const parametricContent = {
|
|
1038
|
+
type: "rectangle",
|
|
1039
|
+
width: 1,
|
|
1040
|
+
height: 1
|
|
1041
|
+
};
|
|
1042
|
+
const rectangle = this._createObject(parametricContent, node);
|
|
1043
|
+
rectangle.fill = rectangle.stroke = [0, 0, 0, 0];
|
|
1044
|
+
}
|
|
1045
|
+
};
|
|
1046
|
+
|
|
997
1047
|
function polarToCartesian(cx, cy, rx, ry, angle) {
|
|
998
1048
|
return [cx + rx * Math.cos(angle), cy + ry * Math.sin(angle)];
|
|
999
1049
|
}
|
|
@@ -1083,6 +1133,8 @@ sap.ui.define([
|
|
|
1083
1133
|
}
|
|
1084
1134
|
node.add(shape);
|
|
1085
1135
|
}
|
|
1136
|
+
|
|
1137
|
+
return shape;
|
|
1086
1138
|
};
|
|
1087
1139
|
|
|
1088
1140
|
SceneBuilder.prototype.createImageNote = function(annotation, sceneId) {
|
|
@@ -17,6 +17,11 @@ sap.ui.define([
|
|
|
17
17
|
) {
|
|
18
18
|
"use strict";
|
|
19
19
|
|
|
20
|
+
// Parametric text content types (sap::ve::core::ParametricType)
|
|
21
|
+
const ptParametricTextData = 10;
|
|
22
|
+
const ptParametricTextSpan = 11;
|
|
23
|
+
const ptParametricTextPath = 12;
|
|
24
|
+
|
|
20
25
|
var Text = function(parameters) {
|
|
21
26
|
parameters = parameters || {};
|
|
22
27
|
Element.call(this, parameters);
|
|
@@ -28,12 +33,11 @@ sap.ui.define([
|
|
|
28
33
|
this.style.size = this.style.size || "1em";
|
|
29
34
|
this.x = parameters.x || 0;
|
|
30
35
|
this.y = parameters.y || 0;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
36
|
+
["dx", "dy", "textAnchor", "alignmentBaseline", "pivot", "anchor"].forEach((prop) => {
|
|
37
|
+
if (parameters[prop] != null) {
|
|
38
|
+
this[prop] = parameters[prop];
|
|
39
|
+
}
|
|
40
|
+
});
|
|
37
41
|
|
|
38
42
|
// If not specified then set default colours for text objects
|
|
39
43
|
this.fillStyle = parameters.fillStyle || { colour: [0, 0, 0, 1] };
|
|
@@ -139,6 +143,12 @@ sap.ui.define([
|
|
|
139
143
|
if (this.dy) {
|
|
140
144
|
setAttributeFunc("dy", this.dy);
|
|
141
145
|
}
|
|
146
|
+
if (this.textAnchor) {
|
|
147
|
+
setAttributeFunc("text-anchor", this.textAnchor);
|
|
148
|
+
}
|
|
149
|
+
if (this.alignmentBaseline) {
|
|
150
|
+
setAttributeFunc("alignment-baseline", this.alignmentBaseline);
|
|
151
|
+
}
|
|
142
152
|
setStyle(this.style, setAttributeFunc, true);
|
|
143
153
|
};
|
|
144
154
|
|
|
@@ -165,12 +175,12 @@ sap.ui.define([
|
|
|
165
175
|
for (var i = 0, l = content.length; i < l; i++) {
|
|
166
176
|
var c = content[i];
|
|
167
177
|
switch (c.type) {
|
|
168
|
-
case
|
|
178
|
+
case ptParametricTextData:
|
|
169
179
|
case undefined:
|
|
170
180
|
case "text":
|
|
171
181
|
rm.text(c.text);
|
|
172
182
|
break;
|
|
173
|
-
case
|
|
183
|
+
case ptParametricTextSpan:
|
|
174
184
|
case "span":
|
|
175
185
|
rm.openStart("tspan");
|
|
176
186
|
setContentAttributes(c, setAttributeFunc);
|
|
@@ -184,7 +194,7 @@ sap.ui.define([
|
|
|
184
194
|
renderContent(c.content, rm);
|
|
185
195
|
rm.close("tspan");
|
|
186
196
|
break;
|
|
187
|
-
case
|
|
197
|
+
case ptParametricTextPath:
|
|
188
198
|
case "path":
|
|
189
199
|
rm.openStart("textPath");
|
|
190
200
|
setContentAttributes(c, setAttributeFunc);
|
|
@@ -232,12 +242,12 @@ sap.ui.define([
|
|
|
232
242
|
for (var i = 0, l = content.length; i < l; i++) {
|
|
233
243
|
var c = content[i];
|
|
234
244
|
switch (c.type) {
|
|
235
|
-
case
|
|
245
|
+
case ptParametricTextData:
|
|
236
246
|
case undefined:
|
|
237
247
|
case "text":
|
|
238
248
|
parentDomRef.append(c.text);
|
|
239
249
|
break;
|
|
240
|
-
case
|
|
250
|
+
case ptParametricTextSpan:
|
|
241
251
|
case "span":
|
|
242
252
|
domRef = document.createElementNS(Element._svgNamespace, "tspan");
|
|
243
253
|
setAttributeFunc = domRef.setAttribute.bind(domRef);
|
|
@@ -251,7 +261,7 @@ sap.ui.define([
|
|
|
251
261
|
createContent(c.content, domRef);
|
|
252
262
|
parentDomRef.append(domRef);
|
|
253
263
|
break;
|
|
254
|
-
case
|
|
264
|
+
case ptParametricTextPath:
|
|
255
265
|
case "path":
|
|
256
266
|
domRef = document.createElementNS(Element._svgNamespace, "textPath");
|
|
257
267
|
setAttributeFunc = domRef.setAttribute.bind(domRef);
|
|
@@ -289,17 +299,21 @@ sap.ui.define([
|
|
|
289
299
|
};
|
|
290
300
|
|
|
291
301
|
function toPixels(size) {
|
|
302
|
+
let value;
|
|
292
303
|
switch (typeof size) {
|
|
293
|
-
case "number":
|
|
304
|
+
case "number": value = size; break;
|
|
294
305
|
case "string":
|
|
295
306
|
if (size.endsWith("pt")) {
|
|
296
|
-
|
|
307
|
+
value = parseFloat(size) * 4 / 3;
|
|
297
308
|
} else if (size.endsWith("em")) {
|
|
298
|
-
|
|
309
|
+
value = parseFloat(size) * 16;
|
|
310
|
+
} else {
|
|
311
|
+
value = parseFloat(size);
|
|
299
312
|
}
|
|
300
|
-
|
|
301
|
-
default:
|
|
313
|
+
break;
|
|
314
|
+
default: value = 0; break;
|
|
302
315
|
}
|
|
316
|
+
return typeof value === "number" && isFinite(value) ? value : 0;
|
|
303
317
|
}
|
|
304
318
|
|
|
305
319
|
function getContent(p) {
|
|
@@ -308,12 +322,12 @@ sap.ui.define([
|
|
|
308
322
|
var node = p.childNodes[i];
|
|
309
323
|
if (node.data !== undefined) {
|
|
310
324
|
content.push({
|
|
311
|
-
type:
|
|
325
|
+
type: ptParametricTextData,
|
|
312
326
|
text: node.data
|
|
313
327
|
});
|
|
314
328
|
} else if (node.childNodes.length > 0) {
|
|
315
329
|
var tspan = {
|
|
316
|
-
type:
|
|
330
|
+
type: ptParametricTextSpan,
|
|
317
331
|
content: getContent(node)
|
|
318
332
|
};
|
|
319
333
|
var nodeStyle = node.style;
|
|
@@ -363,6 +377,7 @@ sap.ui.define([
|
|
|
363
377
|
}
|
|
364
378
|
|
|
365
379
|
Text.prototype.setHtmlTextContent = function(htmlText) {
|
|
380
|
+
// console.log("setHtmlTextContent", htmlText);
|
|
366
381
|
var htmlElem = document.createElement("html");
|
|
367
382
|
htmlElem.innerHTML = htmlText;
|
|
368
383
|
var content = [];
|
|
@@ -379,8 +394,8 @@ sap.ui.define([
|
|
|
379
394
|
y += i > 0 ? maxFontSize : 0;
|
|
380
395
|
}
|
|
381
396
|
content.push({
|
|
382
|
-
type:
|
|
383
|
-
x: (node.style.paddingLeft
|
|
397
|
+
type: ptParametricTextSpan,
|
|
398
|
+
x: toPixels(node.style.paddingLeft) + this.x,
|
|
384
399
|
y: y,
|
|
385
400
|
content: getContent(node)
|
|
386
401
|
});
|
|
@@ -389,7 +404,7 @@ sap.ui.define([
|
|
|
389
404
|
}
|
|
390
405
|
} else if (node.data) {// text node
|
|
391
406
|
content.push({
|
|
392
|
-
type:
|
|
407
|
+
type: ptParametricTextData,
|
|
393
408
|
text: node.data
|
|
394
409
|
});
|
|
395
410
|
}
|
|
@@ -406,14 +421,14 @@ sap.ui.define([
|
|
|
406
421
|
for (var i = 0; i < content.length; i++) {
|
|
407
422
|
var c = content[i];
|
|
408
423
|
switch (c.type) {
|
|
409
|
-
case
|
|
424
|
+
case ptParametricTextData:
|
|
410
425
|
case undefined:
|
|
411
426
|
case "text":
|
|
412
427
|
value += c.text;
|
|
413
428
|
break;
|
|
414
|
-
case
|
|
429
|
+
case ptParametricTextSpan:
|
|
415
430
|
case "span":
|
|
416
|
-
case
|
|
431
|
+
case ptParametricTextPath:
|
|
417
432
|
case "path":
|
|
418
433
|
var style = c.style;
|
|
419
434
|
if (!inlineContent || c.y !== undefined || c.dy !== undefined) {
|
|
@@ -485,12 +500,12 @@ sap.ui.define([
|
|
|
485
500
|
switch (c.type) {
|
|
486
501
|
case undefined:
|
|
487
502
|
case "text":
|
|
488
|
-
content.push({ type:
|
|
503
|
+
content.push({ type: ptParametricTextData, text: c.text });
|
|
489
504
|
break;
|
|
490
505
|
default:
|
|
491
506
|
case "span":
|
|
492
507
|
case "path":
|
|
493
|
-
var tspan = { type: c.type === "path" ?
|
|
508
|
+
var tspan = { type: c.type === "path" ? ptParametricTextPath : ptParametricTextSpan };
|
|
494
509
|
if (c.x !== undefined) {
|
|
495
510
|
tspan.x = c.x;
|
|
496
511
|
}
|
|
@@ -524,13 +539,13 @@ sap.ui.define([
|
|
|
524
539
|
for (var i = 0; i < content.length; i++) {
|
|
525
540
|
var c = content[i];
|
|
526
541
|
switch (c.type) {
|
|
527
|
-
case
|
|
542
|
+
case ptParametricTextData:
|
|
528
543
|
case undefined:
|
|
529
544
|
children.push({ text: c.text });
|
|
530
545
|
break;
|
|
531
|
-
case
|
|
546
|
+
case ptParametricTextSpan:
|
|
532
547
|
case "span":
|
|
533
|
-
case
|
|
548
|
+
case ptParametricTextPath:
|
|
534
549
|
case "path":
|
|
535
550
|
var span = { type: "span" };
|
|
536
551
|
if (c.x !== undefined) {
|
|
@@ -620,5 +635,32 @@ sap.ui.define([
|
|
|
620
635
|
return this;
|
|
621
636
|
};
|
|
622
637
|
|
|
638
|
+
Element.prototype.setCustomText = function(options) {
|
|
639
|
+
if (options == null || (options.text == null && options.htmlText == null)) {
|
|
640
|
+
this.customText = null;
|
|
641
|
+
return this;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
const customText = this.customText = new Text({
|
|
645
|
+
text: options.text,
|
|
646
|
+
pivot: options.pivot ?? [0.5, 0.5],
|
|
647
|
+
anchor: options.anchor ?? [0.5, 0.5],
|
|
648
|
+
style: {
|
|
649
|
+
size: options.size ?? "0px",
|
|
650
|
+
fontFace: options.fontFamily ?? options.fontFace ?? "Arial",
|
|
651
|
+
fontStyle: options.fontStyle,
|
|
652
|
+
fontWeight: options.fontWeight,
|
|
653
|
+
textDecoration: options.textDecoration,
|
|
654
|
+
fill: options.fill ?? "black"
|
|
655
|
+
}
|
|
656
|
+
});
|
|
657
|
+
if (options.htmlText) {
|
|
658
|
+
customText.setHtmlTextContent(options.htmlText);
|
|
659
|
+
}
|
|
660
|
+
customText.userData.customText = true; // mark the custom text element for special hit test handling
|
|
661
|
+
return this;
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
|
|
623
665
|
return Text;
|
|
624
666
|
});
|
|
@@ -49,7 +49,7 @@ sap.ui.define([
|
|
|
49
49
|
* @param {object} [mSettings] Initial settings for the new ViewStateManager object.
|
|
50
50
|
* @public
|
|
51
51
|
* @author SAP SE
|
|
52
|
-
* @version 1.
|
|
52
|
+
* @version 1.141.0
|
|
53
53
|
* @extends sap.ui.vk.ViewStateManagerBase
|
|
54
54
|
* @alias sap.ui.vk.svg.ViewStateManager
|
|
55
55
|
* @since 1.80.0
|
|
@@ -442,7 +442,7 @@ sap.ui.define([
|
|
|
442
442
|
var selected = parentSelected || this._selectedNodes.has(nodeRef);
|
|
443
443
|
|
|
444
444
|
nodeRef.setSelected(this._mask, selected, this._highlightColorABGR);
|
|
445
|
-
if (nodeRef.nodeContentType !== NodeContentType.Hotspot) {// recursively update highlight color for regular nodes
|
|
445
|
+
if (nodeRef.nodeContentType !== NodeContentType.Hotspot && nodeRef.nodeContentType !== NodeContentType.DynamicContent) {// recursively update highlight color for regular nodes
|
|
446
446
|
var children = nodeRef.children;
|
|
447
447
|
for (var i = 0, l = children.length; i < l; i++) {
|
|
448
448
|
this._updateHighlightColor(children[i], selected);
|
|
@@ -76,23 +76,13 @@ sap.ui.define([
|
|
|
76
76
|
*
|
|
77
77
|
* @public
|
|
78
78
|
* @author SAP SE
|
|
79
|
-
* @version 1.
|
|
79
|
+
* @version 1.141.0
|
|
80
80
|
* @extends sap.ui.vk.ViewportBase
|
|
81
81
|
* @alias sap.ui.vk.svg.Viewport
|
|
82
82
|
*/
|
|
83
83
|
var Viewport = ViewportBase.extend("sap.ui.vk.svg.Viewport", /** @lends sap.ui.vk.svg.Viewport.prototype */ {
|
|
84
84
|
metadata: {
|
|
85
85
|
library: "sap.ui.vk",
|
|
86
|
-
// properties: {
|
|
87
|
-
// zoomInLimit: {
|
|
88
|
-
// type: "float",
|
|
89
|
-
// defaultValue: 500
|
|
90
|
-
// },
|
|
91
|
-
// zoomOutLimit: {
|
|
92
|
-
// type: "float",
|
|
93
|
-
// defaultValue: 0.25
|
|
94
|
-
// }
|
|
95
|
-
// },
|
|
96
86
|
aggregations: {
|
|
97
87
|
miniMap: {
|
|
98
88
|
type: "sap.m.Dialog",
|
|
@@ -245,9 +235,11 @@ sap.ui.define([
|
|
|
245
235
|
miniMapDialog.attachBeforeOpen(function() { miniMapDialog.oPopup.setModal(false); }); // dialog should not be modal
|
|
246
236
|
miniMapDialog._calcPosition = () => {
|
|
247
237
|
const rect = this.getDomRef()?.getBoundingClientRect() ?? { top: 0, right: 0 }; // viewport's bounding rect
|
|
238
|
+
const miniMapRect = miniMapDialog.getDomRef()?.getBoundingClientRect() ?? { width: 0, height: 0 }; // mini map dialog's bounding rect
|
|
239
|
+
const lockPos = miniMap._lockPosition;
|
|
248
240
|
return {
|
|
249
|
-
top: rect.top +
|
|
250
|
-
left: rect.right
|
|
241
|
+
top: (lockPos.y >= 0 ? rect.top + lockPos.y : Math.max(rect.bottom + lockPos.y - miniMapRect.height, rect.top)) + "px",
|
|
242
|
+
left: (lockPos.x >= 0 ? rect.left + lockPos.x : Math.max(rect.right + lockPos.x - miniMapRect.width, rect.left)) + "px"
|
|
251
243
|
};
|
|
252
244
|
};
|
|
253
245
|
miniMap.attachSizeChanged((event) => {
|
|
@@ -309,6 +301,97 @@ sap.ui.define([
|
|
|
309
301
|
}
|
|
310
302
|
};
|
|
311
303
|
|
|
304
|
+
Viewport.prototype._updateCustomText = function() {
|
|
305
|
+
const root = this._scene.getRootElement();
|
|
306
|
+
|
|
307
|
+
// collect all font sizes in the scene
|
|
308
|
+
const fontSizes = [];
|
|
309
|
+
root.traverse(function(node) {
|
|
310
|
+
if (node.type === "Text") {
|
|
311
|
+
const fontSizeCSS = node.style.size;
|
|
312
|
+
const fontSize = parseFloat(fontSizeCSS);
|
|
313
|
+
if (fontSize > 0) {
|
|
314
|
+
let unitScale = 1;
|
|
315
|
+
if (typeof fontSizeCSS === "string") {
|
|
316
|
+
if (fontSizeCSS.endsWith("em")) {
|
|
317
|
+
unitScale = 16; // assuming 1em = 16px
|
|
318
|
+
} else if (fontSizeCSS.endsWith("pt")) {
|
|
319
|
+
unitScale = 1.333; // assuming 1pt = 1.333px
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
const m = node._matrixWorld();
|
|
324
|
+
fontSizes.push(fontSize * unitScale * Math.sqrt(m[2] * m[2] + m[3] * m[3]));
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
let fontSize;
|
|
330
|
+
if (fontSizes.length > 0) {// take median font size
|
|
331
|
+
fontSizes.sort();
|
|
332
|
+
fontSize = fontSizes[fontSizes.length >> 1];
|
|
333
|
+
} else {
|
|
334
|
+
const bbox = root.domRef.getBBox();
|
|
335
|
+
fontSize = Math.max(bbox.width, bbox.height) * 0.01;
|
|
336
|
+
}
|
|
337
|
+
fontSize = Math.round(fontSize * 100) / 100; // round to 2 decimal places
|
|
338
|
+
|
|
339
|
+
root.traverse(function(node) {
|
|
340
|
+
if (node.customText?.style.size === "0px") { // "0px" is a special case, it means "default font size"
|
|
341
|
+
node.customText.style.size = fontSize + "px";
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
Viewport.prototype._updateCustomTextFilters = function() {
|
|
347
|
+
const domRef = this._scene?.getRootElement()?.domRef;
|
|
348
|
+
if (domRef) {
|
|
349
|
+
const blurStdDeviation = this.getHotspotCustomTextHaloWidth();
|
|
350
|
+
const dilateRadius = blurStdDeviation * 0.1; // 10% of blur std deviation
|
|
351
|
+
const outlineWidth = this.getHotspotCustomTextOutlineWidth();
|
|
352
|
+
const expand = Math.max(blurStdDeviation + dilateRadius, outlineWidth * 2);
|
|
353
|
+
const color = cssColorToColor(this.getHotspotCustomTextOutlineColor());
|
|
354
|
+
for (const filter of domRef.parentNode.getElementsByTagName("filter")) {
|
|
355
|
+
if (filter.id.endsWith("-custom-text")) {
|
|
356
|
+
if (sap.ui.Device.browser.firefox) {
|
|
357
|
+
filter.setAttribute("x", "-25%");
|
|
358
|
+
filter.setAttribute("y", "-100%");
|
|
359
|
+
filter.setAttribute("width", "150%");
|
|
360
|
+
filter.setAttribute("height", "300%");
|
|
361
|
+
} else {
|
|
362
|
+
filter.setAttribute("x", -expand + "px");
|
|
363
|
+
filter.setAttribute("y", -expand + "px");
|
|
364
|
+
filter.setAttribute("width", `calc(100% + ${expand * 2}px)`);
|
|
365
|
+
filter.setAttribute("height", `calc(100% + ${expand * 2}px)`);
|
|
366
|
+
}
|
|
367
|
+
filter.childNodes[0].setAttribute("radius", dilateRadius); // set morphology dilate radius
|
|
368
|
+
filter.childNodes[2].setAttribute("stdDeviation", blurStdDeviation); // set gaussian blur std deviation
|
|
369
|
+
filter.childNodes[3].setAttribute("radius", outlineWidth); // set morphology dilate radius
|
|
370
|
+
filter.childNodes[5].setAttribute("stdDeviation", outlineWidth); // set gaussian blur std deviation
|
|
371
|
+
filter.childNodes[4].setAttribute("values", `0 0 0 0 ${color.red / 255}, 0 0 0 0 ${color.green / 255}, 0 0 0 0 ${color.blue / 255}, 0 0 0 ${color.alpha} 0`);
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
Viewport.prototype.setHotspotCustomTextOutlineColor = function(cssColor) {
|
|
378
|
+
this.setProperty("hotspotCustomTextOutlineColor", cssColor, true);
|
|
379
|
+
this._updateCustomTextFilters();
|
|
380
|
+
return this;
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
Viewport.prototype.setHotspotCustomTextOutlineWidth = function(width) {
|
|
384
|
+
this.setProperty("hotspotCustomTextOutlineWidth", width, true);
|
|
385
|
+
this._updateCustomTextFilters();
|
|
386
|
+
return this;
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
Viewport.prototype.setHotspotCustomTextHaloWidth = function(width) {
|
|
390
|
+
this.setProperty("hotspotCustomTextHaloWidth", width, true);
|
|
391
|
+
this._updateCustomTextFilters();
|
|
392
|
+
return this;
|
|
393
|
+
};
|
|
394
|
+
|
|
312
395
|
Viewport.prototype.onAfterRendering = function() {
|
|
313
396
|
this._resizeListenerId = ResizeHandler.register(this, this._handleResize.bind(this));
|
|
314
397
|
|
|
@@ -319,6 +402,8 @@ sap.ui.define([
|
|
|
319
402
|
var root = this._scene.getRootElement();
|
|
320
403
|
root._setDomRef(document.getElementById(root.uid));
|
|
321
404
|
this._svgElement = root.domRef.parentNode;
|
|
405
|
+
|
|
406
|
+
this._updateCustomText();
|
|
322
407
|
}
|
|
323
408
|
|
|
324
409
|
this._handleResize({
|
|
@@ -523,28 +608,47 @@ sap.ui.define([
|
|
|
523
608
|
|
|
524
609
|
var rootElement = this._scene.getRootElement();
|
|
525
610
|
var viewportRect = this.getDomRef().getBoundingClientRect();
|
|
611
|
+
x += viewportRect.x;
|
|
612
|
+
y += viewportRect.y;
|
|
526
613
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
614
|
+
function getHit(htmlElement) {
|
|
615
|
+
while (htmlElement && !htmlElement.id) {
|
|
616
|
+
htmlElement = htmlElement.parentElement; // go up the DOM tree to find an element with id
|
|
617
|
+
}
|
|
618
|
+
if (!htmlElement) {
|
|
619
|
+
return null; // element not found
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
const hit = rootElement.getElementById(htmlElement.id);
|
|
623
|
+
const elem = hit?._getSceneTreeElement();
|
|
624
|
+
if (!elem) {
|
|
625
|
+
return null; // element not found in the scene
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
if ((ignoreHotspots && elem._vkGetNodeContentType() === NodeContentType.Hotspot) ||
|
|
629
|
+
hit.userData.customText) {
|
|
630
|
+
return undefined; // ignore hotspots if the "ignoreHotspots" flag is set and ignore custom text elements
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
return hit;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
function hitTest(x, y) {
|
|
637
|
+
const htmlElement = document.elementFromPoint(x, y);
|
|
638
|
+
const hit = getHit(htmlElement);
|
|
639
|
+
if (hit !== undefined) {
|
|
640
|
+
return hit;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
for (const htmlElement of document.elementsFromPoint(x, y)) {
|
|
644
|
+
const hit = getHit(htmlElement);
|
|
645
|
+
if (hit !== undefined) {
|
|
646
|
+
return hit;
|
|
541
647
|
}
|
|
542
|
-
return null;
|
|
543
|
-
} else {
|
|
544
|
-
htmlElement = document.elementFromPoint(x + viewportRect.x, y + viewportRect.y);
|
|
545
|
-
return htmlElement !== null && htmlElement.id ? rootElement.getElementById(htmlElement.id) : null;
|
|
546
648
|
}
|
|
547
|
-
|
|
649
|
+
|
|
650
|
+
return null; // no hit found
|
|
651
|
+
}
|
|
548
652
|
|
|
549
653
|
var hit = hitTest(x, y);
|
|
550
654
|
if (withTolerance) {
|
|
@@ -1288,6 +1392,15 @@ sap.ui.define([
|
|
|
1288
1392
|
activeHotspotChanged = true;
|
|
1289
1393
|
}
|
|
1290
1394
|
|
|
1395
|
+
if (this._dynamicContentElement && this._dynamicContentElement !== elem) {
|
|
1396
|
+
this.fireHotspotLeave({ nodeRef: this._dynamicContentElement });
|
|
1397
|
+
if (!this.getShowAllDynamicContents()) {
|
|
1398
|
+
this._dynamicContentElement.setHotspotColor(vsm._mask, null);
|
|
1399
|
+
}
|
|
1400
|
+
this._dynamicContentElement = null;
|
|
1401
|
+
activeHotspotChanged = true;
|
|
1402
|
+
}
|
|
1403
|
+
|
|
1291
1404
|
if (elem && elem._vkGetNodeContentType() === NodeContentType.Hotspot) {
|
|
1292
1405
|
this._hotspotElement = elem;
|
|
1293
1406
|
if (!this.getShowAllHotspots()) {
|
|
@@ -1297,6 +1410,15 @@ sap.ui.define([
|
|
|
1297
1410
|
activeHotspotChanged = true;
|
|
1298
1411
|
}
|
|
1299
1412
|
|
|
1413
|
+
if (elem && elem._vkGetNodeContentType() === NodeContentType.DynamicContent) {
|
|
1414
|
+
this._dynamicContentElement = elem;
|
|
1415
|
+
if (!this.getShowAllDynamicContents()) {
|
|
1416
|
+
elem.setHotspotColor(vsm._mask, this.getHotspotColorABGR());
|
|
1417
|
+
}
|
|
1418
|
+
this.fireHotspotEnter({ nodeRef: elem });
|
|
1419
|
+
activeHotspotChanged = true;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1300
1422
|
if (activeHotspotChanged) {
|
|
1301
1423
|
this._invalidateRasterImage();
|
|
1302
1424
|
}
|
|
@@ -1645,6 +1767,30 @@ sap.ui.define([
|
|
|
1645
1767
|
return this;
|
|
1646
1768
|
};
|
|
1647
1769
|
|
|
1770
|
+
Viewport.prototype.setShowAllDynamicContents = function(value) {
|
|
1771
|
+
this.setProperty("showAllDynamicContents", value, true);
|
|
1772
|
+
const vsm = this._getViewStateManagerSVG();
|
|
1773
|
+
if (vsm) {
|
|
1774
|
+
const vsmMask = vsm._mask;
|
|
1775
|
+
const nodes = vsm.getNodeHierarchy().getDynamicContentNodeRefs();
|
|
1776
|
+
const dynamicContentElement = this._dynamicContentElement;
|
|
1777
|
+
const color = this.getShowAllHotspotsTintColor();
|
|
1778
|
+
nodes.forEach(function(node) {
|
|
1779
|
+
if (value) {
|
|
1780
|
+
node.setHotspotColor(vsmMask, color);
|
|
1781
|
+
} else if (node === dynamicContentElement) {
|
|
1782
|
+
node.setHotspotColor(vsmMask, this.getHotspotColorABGR());
|
|
1783
|
+
} else {
|
|
1784
|
+
node.setHotspotColor(vsmMask, null);
|
|
1785
|
+
}
|
|
1786
|
+
}, this);
|
|
1787
|
+
|
|
1788
|
+
if (nodes.length > 0) {
|
|
1789
|
+
this.invalidate();
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
};
|
|
1793
|
+
|
|
1648
1794
|
Viewport.prototype._getFillStyleId = function(element) {
|
|
1649
1795
|
if (element.highlightColor || element.tintColor) {
|
|
1650
1796
|
return null;
|