Erasing shapes with the eraser

By default only the sharpie tool and lines/arrows can be erased with the eraser.

To enable erasing other shapes we can override default shape properties. We can use the createMarkupEditorShapeStyles function and override or extend the default styles and settings for a shape.

In the example below we enable erasing the 'rectangle' shape.

<!DOCTYPE html>

<link rel="stylesheet" href="./pintura.css" />

    .pintura-editor {
        height: 600px;

<div id="editor"></div>

<script type="module">
    import {
    } from './pintura.js';

    const editor = appendDefaultEditor('#editor', {
        src: 'image.jpeg',
        util: 'annotate',
        markupEditorToolStyles: createMarkupEditorToolStyles({
            text: createMarkupEditorToolStyle('rectangle', {
                disableErase: false,