sesaparcours
    Preparing search index...

    Fake class which should be extended to avoid inheriting static properties

    Hierarchy (View Summary)

    Index

    Constructors

    • Class for a drag surface for the currently dragged block. This is a separate SVG that contains only the currently moving block, or nothing.

      Parameters

      • container: Element

        Containing element.

      Returns BlockDragSurfaceSvg__Class

    Methods

    • Clear the group and hide the surface; move the blocks off onto the provided element. If the block is being deleted it doesn't need to go back to the original surface, since it would be removed immediately during dispose.

      Parameters

      • Optionalopt_newSurface: Element

        Surface the dragging blocks should be moved to, or null if the blocks should be removed from this surface without being moved to a different surface.

      Returns void

    • Create the drag surface and inject it into the container.

      Returns void

    • Get the current blocks on the drag surface, if any (primarily for BlockSvg.getRelativeToSurfaceXY).

      Returns Element

      Drag surface block DOM element, or null if no blocks exist.

    • Provide a reference to the drag group (primarily for BlockSvg.getRelativeToSurfaceXY).

      Returns SVGElement

      Drag surface group element.

    • Reports the surface translation in scaled workspace coordinates. Use this when finishing a drag to return blocks to the correct position.

      Returns Blockly.utils.Coordinate

      Current translation of the surface.

    • Returns the SVG drag surface.

      Returns SVGElement

      The SVG drag surface.

    • Gets the translation of the child block surface This surface is in charge of keeping track of how much the workspace has moved.

      Returns Blockly.utils.Coordinate

      The amount the workspace has been moved.

    • Set the SVG blocks on the drag surface's group and show the surface. Only one block group should be on the drag surface at a time.

      Parameters

      • blocks: SVGElement

        Block or group of blocks to place on the drag surface.

      Returns void

    • Translate and scale the entire drag surface group to the given position, to keep in sync with the workspace.

      Parameters

      • x: number

        X translation in pixel coordinates.

      • y: number

        Y translation in pixel coordinates.

      • scale: number

        Scale of the group.

      Returns void

    • Translates the entire surface by a relative offset.

      Parameters

      • deltaX: number

        Horizontal offset in pixel units.

      • deltaY: number

        Vertical offset in pixel units.

      Returns void

    • Translate the entire drag surface during a drag. We translate the drag surface instead of the blocks inside the surface so that the browser avoids repainting the SVG. Because of this, the drag coordinates must be adjusted by scale.

      Parameters

      • x: number

        X translation for the entire surface.

      • y: number

        Y translation for the entire surface.

      Returns void