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

    Normally, a fallback pattern is only painted where no other pattern could be painted. This pattern wrapper adds an exception to this. When a pattern is wrapped with a combineWithFallback, this pattern can be painted in addition to a fallback pattern. This is useful for adding a non-filled arrowhead, as in the image example.

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

    const regular = {
    decorations: [{
    location: 0,
    pattern: arrow
    }],
    fallback: linePattern
    };

    const combinedWithFallback = {
    decorations: [{
    location: 0,
    pattern: combineWithFallback(arrowPattern)
    }],
    fallback: linePattern
    };

    Results in:

    PatternFactory.combineWithFallback illustration

    Parameters

    Returns Pattern

    a pattern that allows the fallback pattern to be combined with this pattern.