dist/modules/extras/label-types/SimpleLabelType.js
/**
     * Limit motions inside the artboard
     * @param bounds bounds of the path
     * @param delta
     */
Limit motions inside the artboard
@param bounds bounds of the path
@param delta
Limit motions inside the artboard @param bounds bounds of the path @param delta
limitMotion(delta, bounds) {
        const artboard = this.workspace.artboard;
        if (artboard) {
            const dx_min = artboard.left - bounds.left;
            const dx_max = artboard.right - bounds.right;
            const dy_min = artboard.top - bounds.top;
            const dy_max = artboard.bottom - bounds.bottom;
            if (delta.x < dx_min)
                delta.x = dx_min;
            else if (delta.x > dx_max)
                delta.x = dx_max;
            if (delta.y < dy_min)
                delta.y = dy_min;
            else if (delta.y > dy_max)
                delta.y = dy_max;
        }
        return delta;
    }
limitMotion ( delta , bounds ) { const artboard = this . workspace . artboard ; if ( artboard ) { const dx_min = artboard . left - bounds . left ; const dx_max = artboard . right - bounds . right ; const dy_min = artboard . top - bounds . top ; const dy_max = artboard . bottom - bounds . bottom ; if ( delta . x < dx_min ) delta . x = dx_min ; else if ( delta . x > dx_max ) delta . x = dx_max ; if ( delta . y < dy_min ) delta . y = dy_min ; else if ( delta . y > dy_max ) delta . y = dy_max ; } return delta ; }
Limit motions inside the artboard
 @param bounds bounds of the path
 @param delta
Limit motions inside the artboard @param bounds bounds of the path @param delta
// find delta limits // limit motion