ReadonlyelementThe layer of the icons, over the canvas
Adds the layer to container, over canvas (a child of the container)
Removes the layer, its icons and its stylesheet
The icon element of a widget, while it has one
Checks again which icons can be clicked (WidgetIconOverlayOptions.canClick) at the next update
(the check is not run on each frame). Object3DWidgetsPlugin calls it on a change in the viewer (an update
event: the picking plugin, its options or the selection, the widget options) and when a plugin is added or
removed. A new icon is checked when it is made.
Reads the place and the size of the canvas in the container again, at the next update (the layout is not
read on each frame). Call it when the canvas is resized or moved: Object3DWidgetsPlugin calls it on a resize of
the viewer.
Removes the icon of a widget (a widget that is removed); update also does it for the widgets not given
Places the icons of widgets for camera, makes the icons of new widgets and removes the icons of widgets that
are no longer in the list or no longer in dom mode. Writes the DOM only where something changed.
The icons of light and camera widgets as DOM elements, for
Object3DWidgetsPlugin.iconMode = 'dom': an SVG for each widget whose AHelperWidget.iconMode isdom, in a layer over the canvas in the viewer container.The SVG comes from the same shapes as the sprite texture (getWidgetIconSvg), so both modes look the same; it is sharp at any pixel ratio and icon size, and never in a render, screenshot or recording of the canvas. update places the icons with
transformonly (called after each render, with the camera of the render; the layout is read again only after invalidateViewport), and hides an icon when its widget or a parent is hidden, AHelperWidget.hasIcon is false, or the object is behind the camera or out of its near and far range. An icon whose centre is just out of the canvas still shows the part of it that is on the canvas. Where icons overlap, the nearer one is on top (and gets the click), as with sprites.The pointer: a click or tap on an icon calls WidgetIconOverlayOptions.click when it is a click for the canvas too (shorter than
ObjectPicker.PointerClickMaxTime, moved less thanObjectPicker.PointerClickMaxDistance), the pointer entering and leaving an icon calls WidgetIconOverlayOptions.hover, and a wheel over an icon goes on to the canvas, so the camera still zooms. An icon that cannot be clicked (WidgetIconOverlayOptions.canClick) lets the pointer through to the canvas.The layer has
z-index8, under the other overlays on the canvas (UI layers in CONTRIBUTING.md). Made byObject3DWidgetsPlugin.