• Creates a pattern that allows the regular pattern to be painted on top of the given pattern.

    A regular pattern is a pattern that is repeated along the whole line. Normally, a regular pattern is only painted where no decorations could be painted. This pattern wrapper adds an exception to this. When a pattern is wrapped with a combineWithRegular pattern, the pattern can be painted in addition to the regular pattern. This is useful for adding a non-filled arrowhead, as in the image example.

    Note that using this pattern wrapper implies that a fallback pattern can be painted as well (if part of the regular pattern cannot be painted).

    Also note that if no regular pattern is specified, then this pattern is combined with the fallback pattern instead, as if you are using combineWithFallback for example.

      const arrowPattern = arrow({type: ArrowType.PLAIN, size: 10, line: {width: 2}});
    const linePattern = parallelLine({line: {width: 2}});

    const combinedWithRegular = {
    decorations: [{
    location: 0,
    pattern: combineWithRegular(arrowPattern)
    }],
    regular: linePattern
    };

    Results in:

    PatternFactory.combineWithRegular illustration

    Parameters

    Returns Pattern

    a pattern that allows the regular pattern to be combined with this pattern